Code cleanup
This commit is contained in:
parent
70046dbdca
commit
5829008d58
|
@ -31,15 +31,15 @@ void string_delete(String * string)
|
||||||
int string_append(String ** string, String * append)
|
int string_append(String ** string, String * append)
|
||||||
{
|
{
|
||||||
char * p;
|
char * p;
|
||||||
int len = string_length(*string);
|
int length = string_length(*string);
|
||||||
|
|
||||||
if((p = realloc(string, len + string_length(append) + 1)) == NULL)
|
if((p = realloc(string, length + string_length(append) + 1)) == NULL)
|
||||||
{
|
{
|
||||||
perror("realloc");
|
perror("realloc");
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
*string = p;
|
*string = p;
|
||||||
strcpy(*string + len, append);
|
strcpy(*string + length, append);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user