Fix unverified sscanf result
As reported by cppcheck: src/defi.c:41:7: style: Variable 're' is assigned a value that is never used. [unreadVariable] re = sscanf(buf, "%ld %ld", &one, &two); ^
This commit is contained in:
parent
106f4ac8c9
commit
8318eeee13
1 changed files with 6 additions and 0 deletions
|
@ -1,6 +1,8 @@
|
||||||
/* vim: set sw=4 ts=4 si et: */
|
/* vim: set sw=4 ts=4 si et: */
|
||||||
|
|
||||||
#include "defi.h"
|
#include "defi.h"
|
||||||
|
#include <string.h>
|
||||||
|
#include <errno.h>
|
||||||
|
|
||||||
#define DEBUG 1
|
#define DEBUG 1
|
||||||
|
|
||||||
|
@ -38,6 +40,10 @@ void defi_run(Defi_t * defi){
|
||||||
break;
|
break;
|
||||||
} else {
|
} else {
|
||||||
re = sscanf(buf, "%ld %ld", &one, &two);
|
re = sscanf(buf, "%ld %ld", &one, &two);
|
||||||
|
if (re < 0) {
|
||||||
|
printf("sscanf() failed: %s", strerror(errno));
|
||||||
|
exit(1);
|
||||||
|
}
|
||||||
pDEBUG("=== DEFI READING %ld %ld ===\n", one, two);
|
pDEBUG("=== DEFI READING %ld %ld ===\n", one, two);
|
||||||
defi->_list =
|
defi->_list =
|
||||||
connexcomponentlist_insert_edge(defi->_list, one, two);
|
connexcomponentlist_insert_edge(defi->_list, one, two);
|
||||||
|
|
Loading…
Reference in a new issue