Enlightenment CVS committal Author : kwo Project : e16 Module : e
Dir : e16/e/src Modified Files: groups.c Log Message: Fix group window selection, avoid using strcat. =================================================================== RCS file: /cvs/e/e16/e/src/groups.c,v retrieving revision 1.93 retrieving revision 1.94 diff -u -3 -r1.93 -r1.94 --- groups.c 1 Mar 2007 02:13:35 -0000 1.93 +++ groups.c 4 Mar 2007 23:35:02 -0000 1.94 @@ -364,8 +364,9 @@ static char ** GetWinGroupMemberNames(Group ** groups, int num) { - int i, j; + int i, j, len; char **group_member_strings; + const char *name; group_member_strings = ECALLOC(char *, num); @@ -379,12 +380,16 @@ if (!group_member_strings[i]) break; - group_member_strings[i][0] = 0; + len = 0; for (j = 0; j < groups[i]->num_members; j++) { - strcat(group_member_strings[i], - EwinGetTitle(groups[i]->members[j])); - strcat(group_member_strings[i], "\n"); + name = EwinGetTitle(groups[i]->members[j]); + if (!name) /* Should never happen */ + continue; + len += Esnprintf(group_member_strings[i] + len, 1024 - len, + "%s\n", name); + if (len >= 1024) + break; } } @@ -1146,15 +1151,10 @@ return; } - if (!strcmp(windowid, "*")) - { - ewin = GetContextEwin(); - if (!ewin) - ewin = GetFocusEwin(); - } + ewin = EwinFindByExpr(windowid); if (!ewin) { - IpcPrintf("Error: no such window: %8x", win); + IpcPrintf("Error: no such window: %s", windowid); return; } ------------------------------------------------------------------------- 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