xaizek / vifm (License: GPLv2+) (since 2018-12-07)
Vifm is a file manager with curses interface, which provides Vi[m]-like environment for managing objects within file systems, extended with some useful ideas from mutt.
Commit 1b02fc90e46c3d2f144df1890dc9ac558ac99347

Use assertion to check expectations
Also add this to function comment.

Found by clang-checker.
Author: xaizek
Author date (UTC): 2012-10-18 15:09
Committer name: xaizek
Committer date (UTC): 2012-10-18 15:09
Parent(s): 5970a10e8db657ddd2e5338368cd2c4b26b37ba5
Signing key:
Tree: 411d34589aa19060ba9a7ab7adf37b53744404d8
File Lines added Lines deleted
src/commands.c 7 4
File src/commands.c changed (mode: 100644) (index f0c8738be..22e4a05dd)
31 31 #include <sys/wait.h> #include <sys/wait.h>
32 32 #endif #endif
33 33
34 #include <assert.h>
34 #include <assert.h> /* assert() */
35 35 #include <ctype.h> /* isspace() */ #include <ctype.h> /* isspace() */
36 36 #include <limits.h> /* PATH_MAX */ #include <limits.h> /* PATH_MAX */
37 37 #include <signal.h> #include <signal.h>
 
... ... echo_cmd(const cmd_info_t *cmd_info)
1843 1843 return 1; return 1;
1844 1844 } }
1845 1845
1846 /* Evaluates :echo result for arguments. Returns pointer to newly allocated
1847 * string, which should be freed by caller, or NULL on error. stop_ptr will
1848 * point to the beginning of invalid expression in case of error. */
1846 /* Evaluates :echo result for arguments. args can not be empty string. Returns
1847 * pointer to newly allocated string, which should be freed by caller, or NULL
1848 * on error. stop_ptr will point to the beginning of invalid expression in case
1849 * of error. */
1849 1850 TSTATIC char * TSTATIC char *
1850 1851 eval_echo(const char args[], const char **stop_ptr) eval_echo(const char args[], const char **stop_ptr)
1851 1852 { {
1852 1853 size_t len = 0; size_t len = 0;
1853 1854 char *eval_result = NULL; char *eval_result = NULL;
1854 1855
1856 assert(args[0] != '\0');
1857
1855 1858 while(args[0] != '\0') while(args[0] != '\0')
1856 1859 { {
1857 1860 var_t result = var_false(); var_t result = var_false();
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/vifm

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

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