ipfix: use ws_strtoi function.
authorDario Lombardo <lomato@gmail.com>
Wed, 7 Sep 2016 12:39:46 +0000 (14:39 +0200)
committerGuy Harris <guy@alum.mit.edu>
Fri, 9 Sep 2016 08:38:30 +0000 (08:38 +0000)
Change-Id: Icca32f714381166e505932958b87f9ffab62aa1d
Reviewed-on: https://code.wireshark.org/review/17557
Petri-Dish: Dario Lombardo <lomato@gmail.com>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Guy Harris <guy@alum.mit.edu>
wiretap/ipfix.c

index b43951e335a9916dbc1697333afb4d61d7dd0919..64f38764c94937e6d5f62abfd1b62e4073a58065 100644 (file)
@@ -67,6 +67,8 @@
 #include "file_wrappers.h"
 #include "ipfix.h"
 
+#include <wsutil/strtoi.h>
+
 #if 0
 #define ipfix_debug(...) g_warning(__VA_ARGS__)
 #else
@@ -192,7 +194,7 @@ ipfix_open(wtap *wth, int *err, gchar **err_info)
 
     /* number of records to scan before deciding if this really is IPFIX */
     if ((s = getenv("IPFIX_RECORDS_TO_CHECK")) != NULL) {
-        if ((n = atoi(s)) > 0 && n < 101) {
+        if (ws_strtoi32(s, NULL, &n) && n > 0 && n < 101) {
             records_for_ipfix_check = n;
         }
     }