]> git.ipfire.org Git - thirdparty/tor.git/commitdiff
Use STMT_BEGIN/END in parse_int.c so coccinelle can handle it.
authorNick Mathewson <nickm@torproject.org>
Wed, 9 Oct 2019 16:57:37 +0000 (12:57 -0400)
committerNick Mathewson <nickm@torproject.org>
Tue, 22 Oct 2019 13:32:13 +0000 (09:32 -0400)
src/lib/string/parse_int.c

index fbdd554a47498280c1f7566820bfed2190c89b05..fd4422ecd0f981cdc478b4e115bc83e95c131b72 100644 (file)
@@ -9,6 +9,7 @@
  **/
 
 #include "lib/string/parse_int.h"
+#include "lib/cc/compat_compiler.h"
 
 #include <errno.h>
 #include <stdlib.h>
@@ -17,6 +18,7 @@
 /* Helper: common code to check whether the result of a strtol or strtoul or
  * strtoll is correct. */
 #define CHECK_STRTOX_RESULT()                           \
+  STMT_BEGIN                                            \
   /* Did an overflow occur? */                          \
   if (errno == ERANGE)                                  \
     goto err;                                           \
@@ -38,7 +40,8 @@
  err:                                                   \
   if (ok) *ok = 0;                                      \
   if (next) *next = endptr;                             \
-  return 0
+  return 0;                                             \
+  STMT_END
 
 /** Extract a long from the start of <b>s</b>, in the given numeric
  * <b>base</b>.  If <b>base</b> is 0, <b>s</b> is parsed as a decimal,