Fix a declaration after statement
While at it, add -Wdeclaration-after-statement to AM_CFLAGS to catch these in the future.
This commit is contained in:
parent
7f09f48e7e
commit
1111960120
@ -21,5 +21,5 @@ libjansson_la_LDFLAGS = \
|
||||
|
||||
if GCC
|
||||
# These flags are gcc specific
|
||||
AM_CFLAGS = -Wall -Wextra -Werror
|
||||
AM_CFLAGS = -Wall -Wextra -Wdeclaration-after-statement -Werror
|
||||
endif
|
||||
|
@ -18,10 +18,12 @@ void jsonp_error_init(json_error_t *error, const char *source)
|
||||
|
||||
void jsonp_error_set_source(json_error_t *error, const char *source)
|
||||
{
|
||||
size_t length;
|
||||
|
||||
if(!error || !source)
|
||||
return;
|
||||
|
||||
size_t length = strlen(source);
|
||||
length = strlen(source);
|
||||
if(length < JSON_ERROR_SOURCE_LENGTH)
|
||||
strcpy(error->source, source);
|
||||
else {
|
||||
|
Loading…
Reference in New Issue
Block a user