diff options
| author | Mattias Andrée <maandree@kth.se> | 2016-03-01 18:54:58 +0100 |
|---|---|---|
| committer | Mattias Andrée <maandree@kth.se> | 2016-03-01 18:54:58 +0100 |
| commit | ee47da9c3992a846f3fb236e7796dbb88d44819c (patch) | |
| tree | b524fd3d7b76508e8d08e5b5ad57ae324445020b /src/zload.c | |
| parent | Fix whitespace (diff) | |
| download | libzahl-ee47da9c3992a846f3fb236e7796dbb88d44819c.tar.gz libzahl-ee47da9c3992a846f3fb236e7796dbb88d44819c.tar.bz2 libzahl-ee47da9c3992a846f3fb236e7796dbb88d44819c.tar.xz | |
Avoid using the internal structure as much as possible
Signed-off-by: Mattias Andrée <maandree@kth.se>
Diffstat (limited to 'src/zload.c')
| -rw-r--r-- | src/zload.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/zload.c b/src/zload.c index 9e4521f..e03d911 100644 --- a/src/zload.c +++ b/src/zload.c @@ -17,8 +17,8 @@ zload(z_t a, const void *buffer) } else { a->chars = 0; } - if (a->sign) { + if (!zzero(a)) { memcpy(a->chars, buf, a->used * sizeof(*(a->chars))); } - return sizeof(z_t) - sizeof(a->chars) + (a->sign ? a->used * sizeof(*(a->chars)) : 0); + return sizeof(z_t) - sizeof(a->chars) + (zzero(a) ? 0 : a->used * sizeof(*(a->chars))); } |
