Fix Coverity CIDs: 1220274 and 1220377.
authorwwp <wwp@free.fr>
Tue, 10 Jan 2017 08:59:52 +0000 (09:59 +0100)
committerwwp <wwp@free.fr>
Tue, 10 Jan 2017 08:59:52 +0000 (09:59 +0100)
src/plugins/python/clawsmailmodule.c
src/plugins/python/python-shell.c

index 5ce3b95..aa472e0 100644 (file)
@@ -920,7 +920,8 @@ PyMODINIT_FUNC initclawsmail(void)
 
   /* add module member "compose_window" set to None */
   Py_INCREF(Py_None);
-  PyModule_AddObject(cm_module, "compose_window", Py_None);
+  if (PyModule_AddObject(cm_module, "compose_window", Py_None) == -1)
+         debug_print("Error: Could not add object 'compose_window'\n");
 
   /* initialize classes */
   ok = ok && cmpy_add_node(cm_module);
index 6d2f06d..4ecd3c9 100644 (file)
@@ -210,7 +210,7 @@ parasite_python_shell_process_line(GtkWidget *python_shell)
             g_free(g_queue_pop_tail(priv->history));
     }
 
-    last_char = command[MAX(0, strlen(command) - 1)];
+    last_char = command[MAX(0, (gint)(strlen(command) - 1))];
 
     if (last_char == ':' || last_char == '\\' ||
         (priv->in_block && g_ascii_isspace(command[0])))