mirror of
https://github.com/Llewellynvdm/conky.git
synced 2024-12-27 04:32:55 +00:00
fix for unused results in smapi.c
This commit is contained in:
parent
8662e6630e
commit
aa95dde706
@ -22,6 +22,7 @@
|
|||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
#include "conky.h" /* text_buffer_size, PACKAGE_NAME, maybe more */
|
#include "conky.h" /* text_buffer_size, PACKAGE_NAME, maybe more */
|
||||||
|
#include <errno.h>
|
||||||
#include "temphelper.h"
|
#include "temphelper.h"
|
||||||
#include "logging.h"
|
#include "logging.h"
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
@ -36,8 +37,9 @@ static int smapi_read_int(const char *path)
|
|||||||
{
|
{
|
||||||
FILE *fp;
|
FILE *fp;
|
||||||
int i = 0;
|
int i = 0;
|
||||||
if ((fp = fopen(path, "r")) != NULL) {
|
if ((fp = fopen(path, "r"))) {
|
||||||
fscanf(fp, "%i\n", &i);
|
if (fscanf(fp, "%i\n", &i) < 0)
|
||||||
|
perror("fscanf()");
|
||||||
fclose(fp);
|
fclose(fp);
|
||||||
}
|
}
|
||||||
return i;
|
return i;
|
||||||
@ -63,7 +65,8 @@ static char *smapi_read_str(const char *path)
|
|||||||
FILE *fp;
|
FILE *fp;
|
||||||
char str[256] = "failed";
|
char str[256] = "failed";
|
||||||
if ((fp = fopen(path, "r")) != NULL) {
|
if ((fp = fopen(path, "r")) != NULL) {
|
||||||
fscanf(fp, "%255s\n", str);
|
if (fscanf(fp, "%255s\n", str) < 0)
|
||||||
|
perror("fscanf()");
|
||||||
fclose(fp);
|
fclose(fp);
|
||||||
}
|
}
|
||||||
return strndup(str, text_buffer_size);
|
return strndup(str, text_buffer_size);
|
||||||
|
Loading…
Reference in New Issue
Block a user