diff options
author | Dario Lombardo <lomato@gmail.com> | 2016-09-06 17:44:56 +0200 |
---|---|---|
committer | Guy Harris <guy@alum.mit.edu> | 2016-09-09 07:37:18 +0000 |
commit | 113c1ed24f21f4e3447b9374d109c7606e37d903 (patch) | |
tree | 0e1d73a3b572d95748fb0649dad7be007bbbada2 /wiretap/catapult_dct2000.c | |
parent | 1948f7bd7553f215dc2519a35dcd62e29e35a614 (diff) |
catapult: use ws_strtou/i functions.
Change-Id: I0a9d3674c0cc2d0dba8c1fbeba2d739373cf8655
Reviewed-on: https://code.wireshark.org/review/17535
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>
Diffstat (limited to 'wiretap/catapult_dct2000.c')
-rw-r--r-- | wiretap/catapult_dct2000.c | 18 |
1 files changed, 14 insertions, 4 deletions
diff --git a/wiretap/catapult_dct2000.c b/wiretap/catapult_dct2000.c index 093cd6b9d2..8e422842fd 100644 --- a/wiretap/catapult_dct2000.c +++ b/wiretap/catapult_dct2000.c @@ -25,6 +25,7 @@ #include "wtap-int.h" #include "file_wrappers.h" +#include <wsutil/strtoi.h> #include "catapult_dct2000.h" @@ -924,7 +925,9 @@ parse_line(gchar *linebuff, gint line_length, *context_portp = port_number_string[0] - '0'; } else { - *context_portp = atoi(port_number_string); + if (!ws_strtou8(port_number_string, NULL, context_portp)) { + return FALSE; + } } /* Skip it */ n++; @@ -973,7 +976,9 @@ parse_line(gchar *linebuff, gint line_length, variant = variant_name[0] - '0'; } else { - variant = atoi(variant_name); + if (!ws_strtoi32(variant_name, NULL, &variant)) { + return FALSE; + } } } else { @@ -1198,7 +1203,9 @@ parse_line(gchar *linebuff, gint line_length, /* Convert found value into number */ seconds_buff[seconds_chars] = '\0'; - *seconds = atoi(seconds_buff); + if (!ws_strtoi32(seconds_buff, NULL, seconds)) { + return FALSE; + } /* The decimal point must follow the last of the seconds digits */ if (linebuff[n] != '.') { @@ -1225,7 +1232,10 @@ parse_line(gchar *linebuff, gint line_length, } /* Convert found value into microseconds */ subsecond_decimals_buff[subsecond_decimals_chars] = '\0'; - *useconds = atoi(subsecond_decimals_buff) * 100; + if (!ws_strtoi32(subsecond_decimals_buff, NULL, useconds)) { + return FALSE; + } + (*useconds) *= 100; /* Space character must follow end of timestamp */ if (linebuff[n] != ' ') { |