diff options
author | Igor Pashev <pashev.igor@gmail.com> | 2022-09-30 09:29:44 +0200 |
---|---|---|
committer | Igor Pashev <pashev.igor@gmail.com> | 2022-09-30 09:29:44 +0200 |
commit | f6ed88c61de57c5367ccd8c3b513e327be992fbd (patch) | |
tree | 740397a2fce6dfc53dbd8c471d5c0309fc4d56aa | |
parent | 305b4c8815a99c51566b77c0d244eb09cd2420a5 (diff) | |
download | mendeleev-f6ed88c61de57c5367ccd8c3b513e327be992fbd.tar.gz |
C: finish first formula before others
-rw-r--r-- | mendeleev.c | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/mendeleev.c b/mendeleev.c index f6db8ea..e48b129 100644 --- a/mendeleev.c +++ b/mendeleev.c @@ -150,10 +150,9 @@ explode (const char *word) if (!formula) return NULL; - while (*formula->tail) - for (formula_t * f = formula; f; f = f->next) - if (*f->tail) - advance (f); + for (formula_t * f = formula; f; f = f->next) + while (*f->tail) + advance (f); return formula; } |