summaryrefslogtreecommitdiffstats
path: root/package/config/util.c
diff options
context:
space:
mode:
authorPeter Korsgaard <jacmet@sunsite.dk>2008-06-19 08:11:51 +0000
committerPeter Korsgaard <jacmet@sunsite.dk>2008-06-19 08:11:51 +0000
commite2c32ba54b2fcf27a766e9c3cb427180a03ea056 (patch)
treed807979670ce4d6961f08ce8f2f9da1cdb57c5aa /package/config/util.c
parent1b6f2e0f4c8445100f1ea6bea5b89db15dba0175 (diff)
downloadbuildroot-novena-e2c32ba54b2fcf27a766e9c3cb427180a03ea056.tar.gz
buildroot-novena-e2c32ba54b2fcf27a766e9c3cb427180a03ea056.zip
package/config: rebase from upstream (2.6.24.4)
From Bernhards tree (1af211ea)
Diffstat (limited to 'package/config/util.c')
-rw-r--r--package/config/util.c13
1 files changed, 8 insertions, 5 deletions
diff --git a/package/config/util.c b/package/config/util.c
index d782f4b87..a68f7529e 100644
--- a/package/config/util.c
+++ b/package/config/util.c
@@ -188,12 +188,15 @@ void str_free(struct gstr *gs)
/* Append to growable string */
void str_append(struct gstr *gs, const char *s)
{
- size_t l = strlen(gs->s) + strlen(s) + 1;
- if (l > gs->len) {
- gs->s = realloc(gs->s, l);
- gs->len = l;
+ size_t l;
+ if (s) {
+ l = strlen(gs->s) + strlen(s) + 1;
+ if (l > gs->len) {
+ gs->s = realloc(gs->s, l);
+ gs->len = l;
+ }
+ strcat(gs->s, s);
}
- strcat(gs->s, s);
}
/* Append printf formatted string to growable string */