diff options
Diffstat (limited to 'src/math-variables.c')
-rw-r--r-- | src/math-variables.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/src/math-variables.c b/src/math-variables.c index b8e57cf..225ca9c 100644 --- a/src/math-variables.c +++ b/src/math-variables.c @@ -37,24 +37,24 @@ registers_load(MathVariables *variables) { FILE *f; char line[1024]; - + f = fopen(variables->priv->file_name, "r"); if (!f) return; - + g_hash_table_remove_all(variables->priv->registers); while (fgets(line, 1024, f) != NULL) { char *name, *value; MPNumber *t; - + value = strchr(line, '='); if (!value) continue; *value = '\0'; value = value + 1; - + name = g_strstrip(line); value = g_strstrip(value); @@ -83,7 +83,7 @@ registers_save(MathVariables *variables) f = fopen(variables->priv->file_name, "w"); if (!f) return; - + g_hash_table_iter_init(&iter, variables->priv->registers); while (g_hash_table_iter_next(&iter, &key, &val)) { @@ -107,7 +107,7 @@ math_variables_get_names(MathVariables *variables) gpointer key; gint i = 0; gchar **names; - + g_return_val_if_fail(variables != NULL, NULL); names = g_malloc0(sizeof(gchar *) * (g_hash_table_size(variables->priv->registers) + 1)); |