Commit 935012ed authored by Lorenz Huedepohl's avatar Lorenz Huedepohl
Browse files

Error: sscanf() returns number of items not characaters

parent d5ccaf8a
......@@ -407,7 +407,7 @@ int elpa_int_string_to_value(char *name, char *string, int *value) {
if (int_entries[n].to_string == NULL) {
int val, ret;
ret = sscanf(string, "%d", &val);
if (ret == strlen(string)) {
if (ret == 1) {
*value = val;
return ELPA_OK;
} else {
......@@ -428,7 +428,7 @@ int elpa_int_string_to_value(char *name, char *string, int *value) {
int elpa_double_string_to_value(char *name, char *string, double *value) {
double val;
int ret = sscanf(string, "%lf", &val);
if (ret == strlen(string)) {
if (ret == 1) {
*value = val;
return ELPA_OK;
} else {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment