From 0ac76a6554d40ee948c9d2334d514145ba1471f7 Mon Sep 17 00:00:00 2001 From: Martin Dvorak Date: Sun, 13 Apr 2014 13:16:07 +0200 Subject: [PATCH] Fixing strdup() related warnings --- src/hstr_favorites.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/hstr_favorites.c b/src/hstr_favorites.c index bdfd272..0a0fc4e 100644 --- a/src/hstr_favorites.c +++ b/src/hstr_favorites.c @@ -15,6 +15,8 @@ #define FAVORITE_SEGMENT_SIZE 10 +extern char *strdup(const char *s); + void favorites_init(FavoriteItems *favorites) { favorites->items=NULL; @@ -66,7 +68,7 @@ void favorites_get(FavoriteItems *favorites) while(pe!=NULL) { favorites->items[i]=pb; *pe=0; - favorites->items[i]=strdup(pb); + favorites->items[i]=(char *)strdup(pb); pb=pe+1; pe=strchr(pb, '\n'); i++;