diff options
| author | jvoisin | 2017-12-06 10:54:56 +0100 |
|---|---|---|
| committer | jvoisin | 2017-12-06 10:54:56 +0100 |
| commit | c5400b2789e6c69bdf245a6f24408c16fc0826fa (patch) | |
| tree | 7524994aeca5c552ad2449995175ca7a8c0fa46a /src/sp_utils.c | |
| parent | 529a13648fd9e0c6fa9cfdff877e62ed19185b6c (diff) | |
Fix a format string, thanks to coverity
Diffstat (limited to 'src/sp_utils.c')
| -rw-r--r-- | src/sp_utils.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/sp_utils.c b/src/sp_utils.c index 62cb1a1..18f82fe 100644 --- a/src/sp_utils.c +++ b/src/sp_utils.c | |||
| @@ -1,6 +1,7 @@ | |||
| 1 | #include "php_snuffleupagus.h" | 1 | #include "php_snuffleupagus.h" |
| 2 | 2 | ||
| 3 | #include <fcntl.h> | 3 | #include <fcntl.h> |
| 4 | #include <inttypes.h> | ||
| 4 | #include <stdio.h> | 5 | #include <stdio.h> |
| 5 | #include <stdlib.h> | 6 | #include <stdlib.h> |
| 6 | #include <string.h> | 7 | #include <string.h> |
| @@ -142,7 +143,7 @@ int sp_log_request(const char* folder, const char* text_repr) { | |||
| 142 | const char* key = ZSTR_VAL(variable_key); | 143 | const char* key = ZSTR_VAL(variable_key); |
| 143 | 144 | ||
| 144 | if (Z_TYPE_INFO_P(variable_value) == IS_LONG) { | 145 | if (Z_TYPE_INFO_P(variable_value) == IS_LONG) { |
| 145 | fprintf(file, "%s=%ld\n", key, Z_DVAL_P(variable_value)); | 146 | fprintf(file, "%s=%" PRId64 "\n", key, Z_LVAL_P(variable_value)); |
| 146 | } else if (Z_TYPE_INFO_P(variable_value) == IS_DOUBLE) { | 147 | } else if (Z_TYPE_INFO_P(variable_value) == IS_DOUBLE) { |
| 147 | fprintf(file, "%s=%lf\n", key, Z_DVAL_P(variable_value)); | 148 | fprintf(file, "%s=%lf\n", key, Z_DVAL_P(variable_value)); |
| 148 | } else if (Z_TYPE_INFO_P(variable_value) == IS_ARRAY) { | 149 | } else if (Z_TYPE_INFO_P(variable_value) == IS_ARRAY) { |
