Cppcheck and GCC build warning fixes#65
Conversation
|
My build host details: And toolchain: |
|
Hi @ecki can you please take these changes? |
|
Thanks for the patches, This may take a long time to review |
ecki
left a comment
There was a problem hiding this comment.
Looks mostly fine, I am not sure about the explizite breaks, but I am not up to Date with latest Linzers, so if you think they are ok, then keep them, maybe comment all with unreadhable?
I had some questions inline, can you Check, please?
|
|
||
| argv += optind; | ||
| argc -= optind; | ||
| //argc -= optind; |
There was a problem hiding this comment.
By the time control reaches here, getopt is done.
There was a problem hiding this comment.
Getopt is called for each Interation and I guess it uses the argc if it needs to Look at followup Parameters
There was a problem hiding this comment.
I added braces around the while loop, hope this makes it better.
There was a problem hiding this comment.
Ah not needed i was not reading the Code Close enough, but I think we should keep einer Both or none of both, if no Arguments are processed we don’t need it on the other Hand it makes sure the global State reflect the processed options. Increasing only argv has potential for overflows
There was a problem hiding this comment.
Ok, found a way to use argc as well.
Thanks a lot for spending time on this. I have addressed all of them and responded to few. Please check. |
Signed-off-by: Shreenidhi Shedi <yesshedi@gmail.com>
Signed-off-by: Shreenidhi Shedi <yesshedi@gmail.com>
Signed-off-by: Shreenidhi Shedi <yesshedi@gmail.com>
Signed-off-by: Shreenidhi Shedi <yesshedi@gmail.com>
Signed-off-by: Shreenidhi Shedi <yesshedi@gmail.com>
Signed-off-by: Shreenidhi Shedi <yesshedi@gmail.com>
Signed-off-by: Shreenidhi Shedi <yesshedi@gmail.com>
Signed-off-by: Shreenidhi Shedi <yesshedi@gmail.com>
Signed-off-by: Shreenidhi Shedi <yesshedi@gmail.com>
Signed-off-by: Shreenidhi Shedi <yesshedi@gmail.com>
Signed-off-by: Shreenidhi Shedi <yesshedi@gmail.com>
Signed-off-by: Shreenidhi Shedi <yesshedi@gmail.com>
Signed-off-by: Shreenidhi Shedi <yesshedi@gmail.com>
Signed-off-by: Shreenidhi Shedi <yesshedi@gmail.com>
Signed-off-by: Shreenidhi Shedi <yesshedi@gmail.com>
Signed-off-by: Shreenidhi Shedi <yesshedi@gmail.com>
Signed-off-by: Shreenidhi Shedi <yesshedi@gmail.com>
Signed-off-by: Shreenidhi Shedi <yesshedi@gmail.com>
Signed-off-by: Shreenidhi Shedi <yesshedi@gmail.com>
Signed-off-by: Shreenidhi Shedi <yesshedi@gmail.com>
Signed-off-by: Shreenidhi Shedi <yesshedi@gmail.com>
Signed-off-by: Shreenidhi Shedi <yesshedi@gmail.com>
Signed-off-by: Shreenidhi Shedi <yesshedi@gmail.com>
Signed-off-by: Shreenidhi Shedi <yesshedi@gmail.com>
Signed-off-by: Shreenidhi Shedi <yesshedi@gmail.com>
Signed-off-by: Shreenidhi Shedi <yesshedi@gmail.com>
Signed-off-by: Shreenidhi Shedi <yesshedi@gmail.com>
Signed-off-by: Shreenidhi Shedi <yesshedi@gmail.com>
Signed-off-by: Shreenidhi Shedi <yesshedi@gmail.com>
Signed-off-by: Shreenidhi Shedi <yesshedi@gmail.com>
Signed-off-by: Shreenidhi Shedi <yesshedi@gmail.com>
Signed-off-by: Shreenidhi Shedi <yesshedi@gmail.com>
Signed-off-by: Shreenidhi Shedi <yesshedi@gmail.com>
Signed-off-by: Shreenidhi Shedi <yesshedi@gmail.com>
| if (ferror(f)) { | ||
| perror("/proc/net/sctp/snmp"); | ||
| if (process_fd2(f, filename)) { | ||
| fprintf(stderr, _("%s - parse error\n"), filename); |
There was a problem hiding this comment.
Hm, that now probably writes two Error lines
There was a problem hiding this comment.
Made the process_fd2 similar to process_fd and removed the error message print in process_fd2
ecki
left a comment
There was a problem hiding this comment.
Thanks for seeing that through, will be great if it Passes Werror!
8d6650b to
7b8870d
Compare
This patch series addresses a bunch of items from https://github.com/ecki/net-tools/blob/master/TODO
Please let me know your feedback @ecki