Module Name:    src
Committed By:   uwe
Date:           Tue Apr 18 07:44:21 UTC 2017

Modified Files:
        src/sys/lib/libsa: loadfile_elf32.c

Log Message:
Swap arguments to strncmp() so that the thing we are testing, the
section name, comes first; and so that the length of the string
constant is right next to that constant.


To generate a diff of this commit:
cvs rdiff -u -r1.39 -r1.40 src/sys/lib/libsa/loadfile_elf32.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/lib/libsa/loadfile_elf32.c
diff -u src/sys/lib/libsa/loadfile_elf32.c:1.39 src/sys/lib/libsa/loadfile_elf32.c:1.40
--- src/sys/lib/libsa/loadfile_elf32.c:1.39	Tue Apr 18 06:39:54 2017
+++ src/sys/lib/libsa/loadfile_elf32.c	Tue Apr 18 07:44:20 2017
@@ -1,4 +1,4 @@
-/* $NetBSD: loadfile_elf32.c,v 1.39 2017/04/18 06:39:54 uwe Exp $ */
+/* $NetBSD: loadfile_elf32.c,v 1.40 2017/04/18 07:44:20 uwe Exp $ */
 
 /*
  * Copyright (c) 1997, 2008 The NetBSD Foundation, Inc.
@@ -482,8 +482,8 @@ ELFNAMEEND(loadfile)(int fd, Elf_Ehdr *e
 			case SHT_PROGBITS:
 				if (boot_load_ctf && shstr) {
 					/* got a CTF section? */
-					if (strncmp(".SUNW_ctf",
-					    &shstr[shp[i].sh_name], 10) == 0) {
+					if (strncmp(&shstr[shp[i].sh_name],
+						    ".SUNW_ctf", 10) == 0) {
 						goto havesym;
 					}
 				}

Reply via email to