]> git.cworth.org Git - notmuch/commitdiff
getdelim: Silence a (bogus) compiler warning.
authorCarl Worth <cworth@cworth.org>
Wed, 2 Dec 2009 00:46:21 +0000 (16:46 -0800)
committerCarl Worth <cworth@cworth.org>
Wed, 2 Dec 2009 00:46:21 +0000 (16:46 -0800)
Some compilers complain that result might be used uninitialized in
this function. I believe such compilers simply aren't looking hard
enough, but it's easy enough to silence them.

compat/getdelim.c

index 1bedef7c903ccb1b2296ef59d674a6d2f898f067..407f3d07c7443836a11b5dbc9236337e7e6294e7 100644 (file)
@@ -54,7 +54,7 @@
 ssize_t
 getdelim (char **lineptr, size_t *n, int delimiter, FILE *fp)
 {
-  ssize_t result;
+  ssize_t result = -1;
   size_t cur_len = 0;
 
   if (lineptr == NULL || n == NULL || fp == NULL)