diff --git a/apps/HttpProxy/HttpProxy.c b/apps/HttpProxy/HttpProxy.c index a040d90969..833fdffc01 100644 --- a/apps/HttpProxy/HttpProxy.c +++ b/apps/HttpProxy/HttpProxy.c @@ -3261,12 +3261,13 @@ ShowStats(MainBase mb) { flushLog(f); } +int ever = 1; static int DispatchLoop(MainBase mb) { int waitMillis = 1; int res = 0; - for (;;) { + for (;ever;) { uint64_t nChanges = mb->nChanges; TrySelect(mb); diff --git a/csrc/ccnd/ccnd.c b/csrc/ccnd/ccnd.c index d03110be2a..3b21a20b97 100644 --- a/csrc/ccnd/ccnd.c +++ b/csrc/ccnd/ccnd.c @@ -587,7 +587,7 @@ ccnd_generate_face_guid(struct ccnd_handle *h, struct face *face, int size, range = ~0; else { range = 0; - for (i = i; i < size; i++) + for (; i < size; i++) range = (range << 8) + hi[i] - lo[i]; } if (range < 2) diff --git a/csrc/lib/ccnbtreetest.c b/csrc/lib/ccnbtreetest.c index b07ace6b11..97c322a8ff 100644 --- a/csrc/lib/ccnbtreetest.c +++ b/csrc/lib/ccnbtreetest.c @@ -5,7 +5,7 @@ * */ /* - * Copyright (C) 2011-2012 Palo Alto Research Center, Inc. + * Copyright (C) 2011-2013 Palo Alto Research Center, Inc. * * This work is free software; you can redistribute it and/or modify it under * the terms of the GNU General Public License version 2 as published by the @@ -37,18 +37,17 @@ #include #include -#define FAILIF(cond) do {} while ((cond) && fatal(__func__, __LINE__)) +#define FAILIF(cond) do if (cond) fatal(__func__, __LINE__); while (0) #define CHKSYS(res) FAILIF((res) == -1) #define CHKPTR(p) FAILIF((p) == NULL) -static int +static void fatal(const char *fn, int lineno) { char buf[80] = {0}; snprintf(buf, sizeof(buf)-1, "OOPS - function %s, line %d", fn, lineno); perror(buf); exit(1); - return(0); } /**