Enlightenment CVS committal

Author  : englebass
Project : e17
Module  : apps/e

Dir     : e17/apps/e/src/bin


Modified Files:
        e_int_menus.c 


Log Message:
- No need to use calloc.
- Use const char to store pointers to title.

===================================================================
RCS file: /cvs/e/e17/apps/e/src/bin/e_int_menus.c,v
retrieving revision 1.208
retrieving revision 1.209
diff -u -3 -r1.208 -r1.209
--- e_int_menus.c       4 Apr 2007 13:25:54 -0000       1.208
+++ e_int_menus.c       5 Apr 2007 15:36:37 -0000       1.209
@@ -1254,19 +1254,21 @@
 static const char *
 _e_int_menus_clients_title_abbrv(const char *title)
 {
-   char *abbv, *left, *right;
    int max_len;
 
    max_len = e_config->clientlist_max_caption_len;
    if ((max_len != 0) && (strlen(title) > max_len))
      {
-       abbv = calloc(E_CLIENTLIST_MAX_CAPTION_LEN+4, sizeof(char));
+       char *abbv;
+       const char *left, *right;
+
+       abbv = malloc(E_CLIENTLIST_MAX_CAPTION_LEN + 4);
        left = title;
-       right = title + (strlen(title) - (max_len/2));
-               
-       strncpy(abbv, left, max_len/2);
+       right = title + (strlen(title) - (max_len / 2));
+
+       strncpy(abbv, left, max_len / 2);
        strncat(abbv, "...", 3);
-       strncat(abbv, right, max_len/2);
+       strncat(abbv, right, max_len / 2);
 
        return abbv;
      }



-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys-and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
enlightenment-cvs mailing list
enlightenment-cvs@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/enlightenment-cvs

Reply via email to