Code cleanup

This commit is contained in:
Pierre Pronchery 2005-08-28 11:45:30 +00:00
parent 70046dbdca
commit 5829008d58

View File

@ -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;
} }