File: more-modern-gcc-warnings

package info (click to toggle)
lx-gdb 1.03-16
  • links: PTS
  • area: main
  • in suites: bookworm, bullseye, buster, forky, jessie, jessie-kfreebsd, sid, stretch, trixie
  • size: 252 kB
  • ctags: 238
  • sloc: ansic: 2,832; makefile: 44; sh: 5
file content (40 lines) | stat: -rw-r--r-- 1,163 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
Description: more modern gcc warnings
 Missing string.h in gdbdump (which uses strlen); add explicit
 brackets for modern -Wparentheses warning.
Author: Mark W. Eichin <eichin@thok.org>

--- lx-gdb-1.03.orig/gdbdump.c
+++ lx-gdb-1.03/gdbdump.c
@@ -86,6 +86,7 @@
 
 #include <stdio.h>
 #include <stdlib.h>
+#include <string.h>
 
 #if !defined(TRUE)
 #define TRUE 1
--- lx-gdb-1.03.orig/gdbload.c
+++ lx-gdb-1.03/gdbload.c
@@ -763,17 +763,19 @@ static	char   buf[256];		/* Buffer for c
 		if (end)
 			*end = '\0';
 		sprintf(buf, ";%s;", line);	/* Copy to buffer */
-		if (!strstr(szCategories, buf))
+		if (!strstr(szCategories, buf)) {
 					/* Is it already on the list? */
-			if (strlen(szCategories) + strlen(buf) - 2 > 256)
+                        if (strlen(szCategories) + strlen(buf) - 2 > 256) {
 					/* Would it overflow the list? */
 				die("too many categories");
-			else
+                        } else {
 				if (!strcmp(szCategories, ";;"))
 					/* Is there anything on the list? */
 					strcpy(szCategories, buf);
 				else
 					strcat(szCategories, buf+1);
+                        }
+                }
 		if (end)
 			{	
 			*end = ';';