as: Fix error checking calling setsec() - scc - simple c99 compiler (HTM) git clone git://git.simple-cc.org/scc (DIR) Log (DIR) Files (DIR) Refs (DIR) Submodules (DIR) README (DIR) LICENSE --- (DIR) commit e082102024dc1b108b686cc7b0a5dcd4d4da3185 (DIR) parent 76e99b74c0360b4b3c379339d64b0e873ad675ff (HTM) Author: Roberto E. Vargas Caballero <k0ga@shike2.com> Date: Fri, 15 Mar 2024 20:20:58 +0100 as: Fix error checking calling setsec() It returns NULL in case of error. Diffstat: M src/cmd/as/symbol.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) --- (DIR) diff --git a/src/cmd/as/symbol.c b/src/cmd/as/symbol.c @@ -304,7 +304,7 @@ newsec(Symbol *sym) exit(EXIT_FAILURE); } - if (setsec(obj, &sec->index, sec) < 0) { + if (!setsec(obj, &sec->index, sec)) { fprintf(stderr, "as: error adding section '%s' to output\n", sym->name);