From 6464acff572d2925f16e47b17b6be2285c45d321 Mon Sep 17 00:00:00 2001 From: Patrick Pelissier Date: Fri, 10 Mar 2017 00:08:28 +0100 Subject: [PATCH] Handle a little bit better the empty container case. --- m-dict.h | 2 +- m-list.h | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/m-dict.h b/m-dict.h index d28fc8c4..31ebcb1e 100644 --- a/m-dict.h +++ b/m-dict.h @@ -409,8 +409,8 @@ M_GET_INIT value_oplist (value); \ do { \ bool b = M_GET_IN_STR key_oplist (key, file); \ - if (!b) { c = 0; break; } \ c = fgetc(file); \ + if (!b) { break; } \ if (c != ':') { c = 0; break; } \ b = M_GET_IN_STR value_oplist (value, file); \ if (!b) { c = 0; break; } \ diff --git a/m-list.h b/m-list.h index 67ac91d4..9a956ad0 100644 --- a/m-list.h +++ b/m-list.h @@ -515,9 +515,9 @@ M_GET_INIT oplist (item); \ do { \ bool b = M_GET_IN_STR oplist (item, file); \ - if (!b) { c = 0; break; } \ - M_C3(list_, name, _push_back)(list, item); \ c = fgetc(file); \ + if (!b) { break; } \ + M_C3(list_, name, _push_back)(list, item); \ } while (c == M_GET_SEPARATOR oplist && !feof(file) && !ferror(file)); \ M_GET_CLEAR oplist (item); \ M_C3(list_, name, _reverse)(list); \