for review: distcc compiler warning fixes

6 views
Skip to first unread message

Fergus Henderson

unread,
Oct 20, 2011, 2:38:51 AM10/20/11
to Craig Silverstein, distcc-...@googlegroups.com
This fixes a couple of compiler warnings.

Index: popt/popthelp.c
===================================================================
--- popt/popthelp.c (revision 742)
+++ popt/popthelp.c (working copy)
@@ -678,12 +678,13 @@
/*@globals fileSystem @*/
/*@modifies *str, *fp, fileSystem @*/
{
- char * s = alloca(300); /* larger then the ascii set */
+ size_t size = 300; /* larger then the ascii set */
+ char * s = alloca(size);

s[0] = '\0';
/*@-branchstate@*/ /* FIX: W2DO? */
if (str == NULL) {
- memset(s, 0, sizeof(s));
+ memset(s, 0, size);
str = s;
}
/*@=branchstate@*/
Index: src/dotd.c
===================================================================
--- src/dotd.c (revision 742)
+++ src/dotd.c (working copy)
@@ -103,7 +103,7 @@
}

tmp_dotd = fopen(*new_dotd_fname, "w");
- if ((tmp_dotd == NULL)) {
+ if (tmp_dotd == NULL) {
fclose(dotd);
return 1;
}

patch

Craig Silverstein

unread,
Oct 20, 2011, 1:11:07 PM10/20/11
to Fergus Henderson, distcc-...@googlegroups.com
These looks all good to me.

craig

Reply all
Reply to author
Forward
0 new messages