mirror of
https://github.com/Tha14/toxic.git
synced 2024-11-23 02:53:02 +01:00
fix possible bug
This commit is contained in:
parent
4aa68c8251
commit
81230295cc
@ -117,10 +117,12 @@ void alert_window(ToxWindow *self)
|
|||||||
/* case-insensitive string compare function for use with qsort - same return logic as strcmp */
|
/* case-insensitive string compare function for use with qsort - same return logic as strcmp */
|
||||||
int name_compare(const void *nick1, const void *nick2)
|
int name_compare(const void *nick1, const void *nick2)
|
||||||
{
|
{
|
||||||
char s[strlen(nick1)];
|
int len_s = strlen((const char *) nick1);
|
||||||
char t[strlen(nick2)];
|
int len_t = strlen((const char *) nick2);
|
||||||
strcpy(s, (const char*) nick1);
|
char s[len_s];
|
||||||
strcpy(t, (const char*) nick2);
|
char t[len_t];
|
||||||
|
strcpy(s, (const char *) nick1);
|
||||||
|
strcpy(t, (const char *) nick2);
|
||||||
|
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
@ -133,4 +135,4 @@ int name_compare(const void *nick1, const void *nick2)
|
|||||||
}
|
}
|
||||||
|
|
||||||
return s[i] - t[i];
|
return s[i] - t[i];
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user