xaizek / hstr (License: Apachev2) (since 2018-12-07)
Bash and Zsh shell history suggest box - easily view, navigate, search and manage your command history.
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 Lines added Lines deleted
src/hstr_favorites.c 3 1
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++;
Hints

Before first commit, do not forget to setup your git environment:
git config --global user.name "your_name_here"
git config --global user.email "your@email_here"

Clone this repository using HTTP(S):
git clone https://code.reversed.top/user/xaizek/hstr

Clone this repository using ssh (do not forget to upload a key first):
git clone ssh://rocketgit@code.reversed.top/user/xaizek/hstr

You are allowed to anonymously push to this repository.
This means that your pushed commits will automatically be transformed into a pull request:
... clone the repository ...
... make some changes and some commits ...
git push origin master