dtwm/WmFP: Coverity (memory corruption, moderate)
authorJon Trulson <jon@radscan.com>
Sat, 27 Dec 2014 01:10:07 +0000 (18:10 -0700)
committerJon Trulson <jon@radscan.com>
Sat, 27 Dec 2014 01:10:07 +0000 (18:10 -0700)
cde/programs/dtwm/WmFP.c

index 22dcb6385d38125c820d37633cde29a74806a835..bd7fe7c55586c809e781a269dad39cc41b604f3e 100644 (file)
@@ -745,8 +745,6 @@ WmPanelistShow (Widget w)
    int i;
    Arg al[20];
    int ac;
-   
-
 
    /*  Find the switch data for later processing  */
    
@@ -785,16 +783,15 @@ WmPanelistShow (Widget w)
    if (shell_geometry == NULL)
    {
       Position  x;
-      char      geometry_buffer[32];
 
       if (panel.element_values[PANEL_GEOMETRY].string_value != NULL)
       {
-         shell_geometry = panel.element_values[PANEL_GEOMETRY].parsed_value;
+        shell_geometry = panel.element_values[PANEL_GEOMETRY].parsed_value;
       }
       else
       {
          x = (screen_width > width) ? (Position)(screen_width - width) / 2 : 0;
-         sprintf (geometry_buffer, "+%d-0", x);
+         snprintf (geometry_buffer, 32 - 1, "+%d-0", x);
          shell_geometry = geometry_buffer;
       }