| 114 | |
| 115 | |
| 116 | int |
| 117 | json_norm_string_init(LEX_STRING *string, const char *str, size_t len) |
| 118 | { |
| 119 | string->length= len + 1; |
| 120 | string->str= json_norm_malloc(string->length); |
| 121 | if (!string->str) |
| 122 | { |
| 123 | string->length= 0; |
| 124 | return 1; |
| 125 | } |
| 126 | strncpy(string->str, str, len); |
| 127 | string->str[len]= 0; |
| 128 | return 0; |
| 129 | } |
| 130 | |
| 131 | |
| 132 | void |
no test coverage detected