mirror of
https://github.com/gophernicus/gophernicus.git
synced 2025-01-03 14:56:43 -05:00
Fixed a (non-security) bug in strcut()
This commit is contained in:
parent
d829e6a347
commit
ae960ab8ce
@ -1,3 +1,8 @@
|
||||
2013-08-05 Kim Holviala <kim@holviala.com>
|
||||
|
||||
* Fixed a (non-security) bug in strcut()
|
||||
|
||||
|
||||
2012-12-02 Kim Holviala <kim@holviala.com>
|
||||
|
||||
* Released version 1.4
|
||||
|
4
string.c
4
string.c
@ -51,7 +51,7 @@ void strreplace(char *str, char from, char to)
|
||||
/*
|
||||
* Cut string to width, return resulting width (UTF-8 aware)
|
||||
*/
|
||||
int strcut(char *str, size_t width)
|
||||
size_t strcut(char *str, size_t width)
|
||||
{
|
||||
unsigned char c;
|
||||
int w = 0;
|
||||
@ -71,7 +71,7 @@ int strcut(char *str, size_t width)
|
||||
w++;
|
||||
}
|
||||
|
||||
*str = '\0';
|
||||
if (c) *str = '\0';
|
||||
return w;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user