Commit 0ac76a6554d40ee948c9d2334d514145ba1471f7
Fixing strdup() related warnings
Author: Martin Dvorak
Author date (UTC): 2014-04-13 11:16
Committer name: Martin Dvorak
Committer date (UTC): 2014-04-13 11:16
Parent(s): bd72ff87b2bd237f367b7c443891ce2d429ba0c3
Signing key:
Tree: c9d7bc7a9d3d8580c53199c41196d57259ea4fb1
File src/hstr_favorites.c changed (mode: 100644) (index bdfd272..0a0fc4e) |
15 |
15 |
|
|
16 |
16 |
#define FAVORITE_SEGMENT_SIZE 10 |
#define FAVORITE_SEGMENT_SIZE 10 |
17 |
17 |
|
|
|
18 |
|
extern char *strdup(const char *s); |
|
19 |
|
|
18 |
20 |
void favorites_init(FavoriteItems *favorites) |
void favorites_init(FavoriteItems *favorites) |
19 |
21 |
{ |
{ |
20 |
22 |
favorites->items=NULL; |
favorites->items=NULL; |
|
... |
... |
void favorites_get(FavoriteItems *favorites) |
66 |
68 |
while(pe!=NULL) { |
while(pe!=NULL) { |
67 |
69 |
favorites->items[i]=pb; |
favorites->items[i]=pb; |
68 |
70 |
*pe=0; |
*pe=0; |
69 |
|
favorites->items[i]=strdup(pb); |
|
|
71 |
|
favorites->items[i]=(char *)strdup(pb); |
70 |
72 |
pb=pe+1; |
pb=pe+1; |
71 |
73 |
pe=strchr(pb, '\n'); |
pe=strchr(pb, '\n'); |
72 |
74 |
i++; |
i++; |