anjuta/anjuta-invalid-comparison.patch

19 lines
777 B
Diff

http://bugzilla.gnome.org/show_bug.cgi?id=489798
Expression compares a char* pointer with a string literal.
Usually a strcmp() was intended by the programmer
anjuta stringcompare vggeneralprefs.c: 371
vggeneralprefs.c: In function 'general_prefs_get_argv':
vggeneralprefs.c:371: warning: comparison with string literal results in unspecified behaviour
================================================================================
--- plugins/valgrind/vggeneralprefs.c
+++ plugins/valgrind/vggeneralprefs.c
@@ -368,7 +368,7 @@
continue;
}
- if (general_args[i].key == SUPPRESSIONS_KEY &&
+ if (!strcmp (general_args[i].key, SUPPRESSIONS_KEY) &&
(stat (str, &st) == -1 || !S_ISREG (st.st_mode))) {
general_args[i].buf = NULL;
g_free (str);