File: cppcheck.patch

package info (click to toggle)
mdk 1.3.1%2Bdfsg-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 4,016 kB
  • sloc: ansic: 22,682; sh: 6,167; lisp: 1,118; lex: 830; makefile: 582; yacc: 288; python: 124
file content (32 lines) | stat: -rw-r--r-- 842 bytes parent folder | download | duplicates (3)
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
Description: Fix some problems detected by cppcheck.
Forwarded: no
Author: Peter Pentchev <roam@ringlet.net>
Last-Update: 2014-02-11

--- a/mixgtk/mixgtk_mixal.c
+++ b/mixgtk/mixgtk_mixal.c
@@ -255,7 +255,7 @@
       gchar *new_tip;
       gchar **tokens;
       gchar *text = g_strdup (line);
-      text = g_strdelimit (text, DELIMITERS, ' ');
+      g_strdelimit (text, DELIMITERS, ' ');
       tokens = g_strsplit (g_strstrip (text), " ", -1);
       while (tokens[k])
 	{
--- a/mixutils/mixvm_loop.c
+++ b/mixutils/mixvm_loop.c
@@ -53,7 +53,12 @@
   enum {LINE_LEN = 256};
   char *line = g_new (char, LINE_LEN);
   printf ("%s", prompt);
-  return fgets (line, LINE_LEN, stdin);
+  if (fgets (line, LINE_LEN, stdin) == NULL)
+    {
+      g_free(line);
+      return (NULL);
+    }
+  return (line);
 }
 #endif /* HAVE_LIBREADLINE */