git.samba.org
/
metze
/
samba
/
wip.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
8f16d23
)
s3:utils:log2pcaphex: fix O3 error unused result of fgets
author
Michael Adam
<obnox@samba.org>
Tue, 5 Apr 2016 17:56:25 +0000
(19:56 +0200)
committer
Michael Adam
<obnox@samba.org>
Thu, 12 May 2016 22:16:16 +0000
(
00:16
+0200)
Signed-off-by: Michael Adam <obnox@samba.org>
Reviewed-by: Christian Ambach <ambi@samba.org>
source3/utils/log2pcaphex.c
patch
|
blob
|
history
diff --git
a/source3/utils/log2pcaphex.c
b/source3/utils/log2pcaphex.c
index 23526c2bc01cc1c911b32500763dcfb08c23055e..2d68db6fac95e399591005d6efbcf033301faa1f 100644
(file)
--- a/
source3/utils/log2pcaphex.c
+++ b/
source3/utils/log2pcaphex.c
@@
-350,7
+350,13
@@
int main(int argc, const char **argv)
if(!hexformat)print_pcap_header(out);
while(!feof(in)) {
- fgets(buffer, sizeof(buffer), in); line_num++;
+ char *p;
+ p = fgets(buffer, sizeof(buffer), in);
+ if (p == NULL) {
+ fprintf(stderr, "error reading from input file\n");
+ break;
+ }
+ line_num++;
if(buffer[0] == '[') { /* Header */
if(strstr(buffer, "show_msg")) {
in_packet++;