]> git.ipfire.org Git - thirdparty/bird.git/commitdiff
Clearness of code of usage variable argument lists
authorPavel Tvrdík <pawel.tvrdik@gmail.com>
Tue, 29 Mar 2016 08:37:31 +0000 (10:37 +0200)
committerPavel Tvrdík <pawel.tvrdik@gmail.com>
Wed, 30 Mar 2016 15:11:17 +0000 (17:11 +0200)
All cases are exiting from BIRD, so the patch is a little useless,
however it will be good for copiage of this code.

client/util.c
conf/conf.c
sysdep/unix/log.c

index 050224b97775b8b245771247227fd3101c2ca409..826cd48d68124351189e1736d6bdbf26932447b5 100644 (file)
@@ -37,6 +37,7 @@ bug(const char *msg, ...)
   fputs("Internal error: ", stderr);
   vlog(msg, args);
   vfprintf(stderr, msg, args);
+  va_end(args);
   exit(1);
 }
 
@@ -48,5 +49,6 @@ die(const char *msg, ...)
   va_start(args, msg);
   cleanup();
   vlog(msg, args);
+  va_end(args);
   exit(1);
 }
index b4474ce66eb06105bba3256093b3b6198c41a0df..54a87d12a5c67663c166d2cf7d7869d17b8f38ec 100644 (file)
@@ -507,6 +507,7 @@ cf_error(const char *msg, ...)
   va_start(args, msg);
   if (bvsnprintf(buf, sizeof(buf), msg, args) < 0)
     strcpy(buf, "<bug: error message too long>");
+  va_end(args);
   new_config->err_msg = cfg_strdup(buf);
   new_config->err_lino = ifs->lino;
   new_config->err_file_name = ifs->file_name;
index 7cb26360a520e0a587e123526112bbfe059329d1..5cd15156b11230de7000338a9f93206bf94b3b19 100644 (file)
@@ -208,6 +208,7 @@ bug(const char *msg, ...)
 
   va_start(args, msg);
   vlog(L_BUG[0], msg, args);
+  va_end(args);
   abort();
 }
 
@@ -225,6 +226,7 @@ die(const char *msg, ...)
 
   va_start(args, msg);
   vlog(L_FATAL[0], msg, args);
+  va_end(args);
   exit(1);
 }