diff options
Diffstat (limited to 'src/blogc-git-receiver')
-rw-r--r-- | src/blogc-git-receiver/pre-receive-parser.c | 4 | ||||
-rw-r--r-- | src/blogc-git-receiver/pre-receive-parser.h | 4 | ||||
-rw-r--r-- | src/blogc-git-receiver/pre-receive.c | 2 |
3 files changed, 6 insertions, 4 deletions
diff --git a/src/blogc-git-receiver/pre-receive-parser.c b/src/blogc-git-receiver/pre-receive-parser.c index fb4c4d5..a5d1e8d 100644 --- a/src/blogc-git-receiver/pre-receive-parser.c +++ b/src/blogc-git-receiver/pre-receive-parser.c @@ -6,6 +6,7 @@ * See the file LICENSE. */ +#include <stddef.h> #include <stdlib.h> #include <string.h> #include "../common/utils.h" @@ -22,12 +23,11 @@ typedef enum { char* -bgr_pre_receive_parse(const char *input) +bgr_pre_receive_parse(const char *input, size_t input_len) { input_state_t state = START_OLD; size_t start = 0; size_t start_new = 0; - size_t input_len = strlen(input); for (size_t current = 0; current < input_len; current++) { diff --git a/src/blogc-git-receiver/pre-receive-parser.h b/src/blogc-git-receiver/pre-receive-parser.h index 7a011a7..e5a392a 100644 --- a/src/blogc-git-receiver/pre-receive-parser.h +++ b/src/blogc-git-receiver/pre-receive-parser.h @@ -9,6 +9,8 @@ #ifndef _PRE_RECEIVE_PARSER_H #define _PRE_RECEIVE_PARSER_H -char* bgr_pre_receive_parse(const char *input); +#include <stddef.h> + +char* bgr_pre_receive_parse(const char *input, size_t input_len); #endif /* _PRE_RECEIVE_PARSER_H */ diff --git a/src/blogc-git-receiver/pre-receive.c b/src/blogc-git-receiver/pre-receive.c index 107459e..76cf1bf 100644 --- a/src/blogc-git-receiver/pre-receive.c +++ b/src/blogc-git-receiver/pre-receive.c @@ -171,7 +171,7 @@ default_sym: } else { char *input = bc_stdin_read(); - master = bgr_pre_receive_parse(input); + master = bgr_pre_receive_parse(input, strlen(input)); free(input); } |