You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@commons.apache.org by mt...@apache.org on 2003/09/27 20:07:55 UTC

cvs commit: jakarta-commons/daemon/src/native/nt/procrun procgui.c

mturk       2003/09/27 11:07:55

  Modified:    daemon/src/native/nt/procrun procgui.c
  Log:
  NULL string ListBox fixes
  
  Revision  Changes    Path
  1.2       +9 -2      jakarta-commons/daemon/src/native/nt/procrun/procgui.c
  
  Index: procgui.c
  ===================================================================
  RCS file: /home/cvs/jakarta-commons/daemon/src/native/nt/procrun/procgui.c,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- procgui.c	4 Sep 2003 23:28:20 -0000	1.1
  +++ procgui.c	27 Sep 2003 18:07:55 -0000	1.2
  @@ -183,6 +183,8 @@
   static char *ac_lv_clmsg = NULL;
   static int  ac_lv_iicon = 0;
   
  +#define STR_NOT_NULL(s) { if((s) == NULL) (s) = ""; }
  +
   static void ac_parse_list_string(const char *str)
   {
       int row = 0x7FFFFFFF;
  @@ -228,12 +230,17 @@
               ac_lv_iicon = 2;
               off = STRN_SIZE("SEVERE:") + 1;
           }
  -        ac_lv_clmsg = (char *)str + off;
  -
  +        ac_lv_clmsg = (char *)str + off;
  +
           /* skip leading spaces */
           while (*ac_lv_clmsg && isspace(*ac_lv_clmsg))
               ++ac_lv_clmsg;
       }
  +
  +    STR_NOT_NULL(ac_lv_class);
  +    STR_NOT_NULL(ac_lv_clmsg);
  +    STR_NOT_NULL(ac_lv_stat);
  +
       memset(&lvi, 0, sizeof(LV_ITEM));
       lvi.mask        = LVIF_IMAGE | LVIF_TEXT;
       lvi.iItem       = ac_lview_current;