Skip to content

Commit 1017d44

Browse files
btrillerlarsewi
andauthored
libenv/sysinfo: Check on lowercase
Co-authored-by: Lars Erik Wik <53906608+larsewi@users.noreply.github.com>
1 parent 22ad5d6 commit 1017d44

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

libenv/sysinfo.c

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -549,6 +549,12 @@ static void GetNameInfo3(EvalContext *ctx)
549549
bool found = false;
550550
for (i = 0; !found && (i < PLATFORM_CONTEXT_MAX); i++)
551551
{
552+
#ifndef NDEBUG
553+
for (const char *ch = VSYSNAME.sysname; *ch != '\0'; ch++)
554+
{
555+
assert(islower(*ch));
556+
}
557+
#endif /* NDEBUG */
552558
/* FIXME: review those strcmps. Moved out from StringMatch */
553559
if (!strcmp(CLASSATTRIBUTES[i][0], VSYSNAME.sysname)
554560
|| StringMatchFull(CLASSATTRIBUTES[i][0], VSYSNAME.sysname))

0 commit comments

Comments
 (0)