use a_strncpy
This commit is contained in:
parent
8d2f292bef
commit
e0d87ae0d9
9
widget.c
9
widget.c
|
@ -146,7 +146,7 @@ uicb_widget_tell(int screen, char *arg)
|
||||||
{
|
{
|
||||||
Widget *widget;
|
Widget *widget;
|
||||||
char *p, *command;
|
char *p, *command;
|
||||||
int len;
|
ssize_t len;
|
||||||
|
|
||||||
if (!arg)
|
if (!arg)
|
||||||
{
|
{
|
||||||
|
@ -169,11 +169,12 @@ uicb_widget_tell(int screen, char *arg)
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if(p + a_strlen(p) < arg+len)
|
if(p + a_strlen(p) < arg + len)
|
||||||
{
|
{
|
||||||
p = p + a_strlen(p) + 1;
|
p = p + a_strlen(p) + 1;
|
||||||
command = p_new(char, a_strlen(p) + 1);
|
len = a_strlen(p);
|
||||||
strncpy(command, p, a_strlen(p));
|
command = p_new(char, len + 1);
|
||||||
|
a_strncpy(command, len + 1, p, len);
|
||||||
widget->tell(widget, command);
|
widget->tell(widget, command);
|
||||||
p_delete(&command);
|
p_delete(&command);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue