diff options
author | Guy Harris <guy@alum.mit.edu> | 2014-09-07 02:15:45 -0700 |
---|---|---|
committer | Guy Harris <guy@alum.mit.edu> | 2014-09-07 09:16:24 +0000 |
commit | ef444d33fa380922c6ee17bd13d12a16e9505f71 (patch) | |
tree | c0c6e0ea64624852654967116c98036e2614367f /ui/qt/sctp_chunk_statistics_dialog.cpp | |
parent | 419de19c1dac8c2a922e3d6f455bd02dec7e9f25 (diff) | |
download | wireshark-ef444d33fa380922c6ee17bd13d12a16e9505f71.tar.gz |
Squelch a compiler warning and get rid of an unnecessary variable.
Just use "sizeof line" for the size of that array; don't have a separate
variable with the number of elements of the array (which at least is
equal to the size of the array, as it's an array of char), as that means
that you have to remember to change both of them.
Then cast "sizeof line" to int, as the second argument to fgets() is an
int, not a size_t (fgets(), as I remember, existed before size_t).
Change-Id: I3c65774527f4fcd824d7ae39208ab6e8e33eb9b4
Reviewed-on: https://code.wireshark.org/review/4023
Reviewed-by: Guy Harris <guy@alum.mit.edu>
Diffstat (limited to 'ui/qt/sctp_chunk_statistics_dialog.cpp')
-rw-r--r-- | ui/qt/sctp_chunk_statistics_dialog.cpp | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/ui/qt/sctp_chunk_statistics_dialog.cpp b/ui/qt/sctp_chunk_statistics_dialog.cpp index 95bf9b12b1..0d0e675ca7 100644 --- a/ui/qt/sctp_chunk_statistics_dialog.cpp +++ b/ui/qt/sctp_chunk_statistics_dialog.cpp @@ -132,12 +132,11 @@ void SCTPChunkStatisticsDialog::fillTable(bool all) } } else { char line[100]; - size_t cap = 100; char *token, id[5]; int i = 0, j = 0; struct chunkTypes temp; - while (fgets(line, cap, fp)) { + while (fgets(line, (int)sizeof line, fp)) { if (line[0] == '#') continue; token = strtok(line, ","); |