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

safer string handling

This commit is contained in:
Jfreegman
2014-10-03 17:53:50 -04:00
parent c56c6cc219
commit 23cf9686cb
12 changed files with 87 additions and 65 deletions

View File

@ -100,6 +100,10 @@ void str_to_lower(char *str);
Returns nick len on success, -1 on failure */
int get_nick_truncate(Tox *m, char *buf, int friendnum);
/* copies data to msg buffer.
returns length of msg, which will be no larger than size-1 */
uint16_t copy_tox_str(char *msg, size_t size, const char *data, uint16_t length);
/* 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);