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:
Glenn Y. Rolland 2020-02-14 08:26:39 +01:00
parent 106f4ac8c9
commit 8318eeee13

View file

@ -1,6 +1,8 @@
/* vim: set sw=4 ts=4 si et: */
#include "defi.h"
#include <string.h>
#include <errno.h>
#define DEBUG 1
@ -38,6 +40,10 @@ void defi_run(Defi_t * defi){
break;
} else {
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);
defi->_list =
connexcomponentlist_insert_edge(defi->_list, one, two);