diff options
| author | iceyrazor <iceyrazor@mailfence.com> | 2026-02-27 20:24:10 -0600 |
|---|---|---|
| committer | iceyrazor <iceyrazor@mailfence.com> | 2026-02-27 20:24:10 -0600 |
| commit | b6a561f81c569ccc63423dc69eca4bc082ea60e9 (patch) | |
| tree | 3bb222fc93b3a53f7398450d820e80ca73fcf5c8 /src/helper_functions.c | |
| parent | 1eb83090ac4b5a31b352a843c85304df9af1f3e0 (diff) | |
better pop
fixed poping quotes that shouldnt be popdddd
Diffstat (limited to 'src/helper_functions.c')
| -rw-r--r-- | src/helper_functions.c | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/src/helper_functions.c b/src/helper_functions.c index c1931fd..162cf45 100644 --- a/src/helper_functions.c +++ b/src/helper_functions.c @@ -16,6 +16,22 @@ void *malloce(size_t size){ return mal; } +char *pop(char *token, int ch_i){ + if(token[ch_i]=='\0'){ + return token; + } + + char *right=(char*)malloce(sizeof(char)*strlen(token)+1); + + strcpy(right,&token[ch_i+1]); + token[ch_i]='\0'; + strcat(token,right); + + free(right); + return token; +} + + // You must free the result if result is non-NULL. char *str_replace(char *orig, char *rep, char *with) { char *result; // the return string |
