1
0
mirror of https://github.com/Tha14/toxic.git synced 2025-06-29 00:36:45 +02:00

fix undefined behaviour with string literals

This commit is contained in:
Jfreegman
2014-07-16 12:47:14 -04:00
parent b23ae5a4c3
commit ce4f293574
6 changed files with 56 additions and 35 deletions

View File

@ -52,7 +52,7 @@ struct tm *get_time(void);
void update_unix_time(void);
/* Returns 1 if the string is empty, 0 otherwise */
int string_is_empty(char *string);
int string_is_empty(const char *string);
/* convert a multibyte string to a wide character string (must provide buffer) */
int char_to_wcs_buf(wchar_t *buf, const char *string, size_t n);
@ -89,4 +89,8 @@ void str_to_lower(char *str);
Returns nick len on success, -1 on failure */
int get_nick_truncate(Tox *m, char *buf, int friendnum);
/* returns index of the first instance of ch in s starting at idx.
returns length of s if char not found */
int char_find(int idx, const char *s, char ch);
#endif /* #define _misc_tools_h */