diff options
| author | 2025-08-05 10:38:20 -0400 | |
|---|---|---|
| committer | 2025-08-05 10:40:21 -0400 | |
| commit | eaf84a7850f2af70b16fb417cd002f5e39df5db2 (patch) | |
| tree | cdcdd09f0e617da594d562998096864a7cd52764 /src/util | |
| parent | 3ea974dd51b1f01483bad6a4d115189928bbf4db (diff) | |
| download | libnaunet-eaf84a7850f2af70b16fb417cd002f5e39df5db2.tar.gz libnaunet-eaf84a7850f2af70b16fb417cd002f5e39df5db2.tar.bz2 libnaunet-eaf84a7850f2af70b16fb417cd002f5e39df5db2.zip | |
Re-add sending array to packet_pool, build fixes
Signed-off-by: Andrew Opalach <andrew@akon.city>
Diffstat (limited to 'src/util')
| -rw-r--r-- | src/util/file/util.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/src/util/file/util.c b/src/util/file/util.c index a2201a7..2f1fa36 100644 --- a/src/util/file/util.c +++ b/src/util/file/util.c @@ -15,12 +15,13 @@ s32 nn_file_read_as_str(struct nn_file *file, str *out) s32 nn_file_read_as_c_str(struct nn_file *file, char **out) { size_t size = file->size; - *out = (char *)al_malloc(size + 1); - if (!nn_file_read(file, (void *)*out, size)) { + char *c_str = (char *)al_malloc(size + 1); + if (!nn_file_read(file, c_str, size)) { al_free(*out); return -1; } - (*out)[size] = '\n'; + c_str[size] = '\n'; + *out = c_str; return size; } |