mirror of
https://github.com/dvorka/hstr.git
synced 2025-01-06 15:08:13 +08:00
Fixing strdup() related warnings
This commit is contained in:
parent
bd72ff87b2
commit
0ac76a6554
1 changed files with 3 additions and 1 deletions
|
@ -15,6 +15,8 @@
|
||||||
|
|
||||||
#define FAVORITE_SEGMENT_SIZE 10
|
#define FAVORITE_SEGMENT_SIZE 10
|
||||||
|
|
||||||
|
extern char *strdup(const char *s);
|
||||||
|
|
||||||
void favorites_init(FavoriteItems *favorites)
|
void favorites_init(FavoriteItems *favorites)
|
||||||
{
|
{
|
||||||
favorites->items=NULL;
|
favorites->items=NULL;
|
||||||
|
@ -66,7 +68,7 @@ void favorites_get(FavoriteItems *favorites)
|
||||||
while(pe!=NULL) {
|
while(pe!=NULL) {
|
||||||
favorites->items[i]=pb;
|
favorites->items[i]=pb;
|
||||||
*pe=0;
|
*pe=0;
|
||||||
favorites->items[i]=strdup(pb);
|
favorites->items[i]=(char *)strdup(pb);
|
||||||
pb=pe+1;
|
pb=pe+1;
|
||||||
pe=strchr(pb, '\n');
|
pe=strchr(pb, '\n');
|
||||||
i++;
|
i++;
|
||||||
|
|
Loading…
Reference in a new issue