Linux Headquarters
[ Register ]
[ About us ] [ Home Page ]

Advertisement
[ Kernel ] [ Documentation ] [ Links ] [ Books ]

Advertisement

Kernel v2.6.24 /scripts/kconfig/util.c

Filename:/scripts/kconfig/util.c
Lines Added:8
Lines Deleted:5
Also changed in: (Previous) 2.6.24-rc8  2.6.24-rc7  2.6.24-rc6  2.6.24-rc5  2.6.24-rc4  2.6.24-rc3 
(Following) 2.6.24-git6  2.6.24-git7  2.6.24-git8  2.6.24-git9  2.6.24-git10  2.6.24-git11 

Location
[  2.6.24
  [  scripts
    [  kconfig
       o  util.c

Patch

diff --git a/scripts/kconfig/util.c b/scripts/kconfig/util.c
index e3f28b9..e1cad92 100644
--- a/scripts/kconfig/util.c
+++ b/scripts/kconfig/util.c
@@ -84,12 +84,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 */


Comments: webmaster (at) linuxhq.com.
Advertising: banners (at) linuxhq.com.
Compilation ©1998-2008 Linux Headquarters, Inc.