hun#2005643 tidy string functions
This commit is contained in:
parent
ea3a92e522
commit
a10d892e2b
|
@ -1,6 +1,7 @@
|
||||||
2010-03-04 Caolán McNamara <cmc at OOo>:
|
2010-03-04 Caolán McNamara <cmc at OOo>:
|
||||||
* hun#1724558 tidy substring.c a little
|
* hun#1724558 tidy substring.c a little
|
||||||
* hun#1999737 add some malloc checks
|
* hun#1999737 add some malloc checks
|
||||||
|
* hun#2005643 tidy string functions
|
||||||
|
|
||||||
2010-02-23 László Németh <nemeth at OOo>:
|
2010-02-23 László Németh <nemeth at OOo>:
|
||||||
* hyphen.c: fix lefthyphenmin calculation for UTF-8 encoded input
|
* hyphen.c: fix lefthyphenmin calculation for UTF-8 encoded input
|
||||||
|
|
6
csutil.c
6
csutil.c
|
@ -42,9 +42,9 @@ char * mystrdup(const char * s)
|
||||||
{
|
{
|
||||||
char * d = NULL;
|
char * d = NULL;
|
||||||
if (s) {
|
if (s) {
|
||||||
int sl = strlen(s);
|
int sl = strlen(s+1);
|
||||||
d = (char *) malloc(((sl+1) * sizeof(char)));
|
d = (char *) malloc(sl);
|
||||||
if (d) memcpy(d,s,((sl+1)*sizeof(char)));
|
if (d) memcpy(d,s,sl);
|
||||||
}
|
}
|
||||||
return d;
|
return d;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue