aboutsummaryrefslogtreecommitdiffstats
path: root/sds.h
diff options
context:
space:
mode:
Diffstat (limited to 'sds.h')
-rw-r--r--sds.h4
1 files changed, 2 insertions, 2 deletions
diff --git a/sds.h b/sds.h
index 54c47e0..ab6fc9c 100644
--- a/sds.h
+++ b/sds.h
@@ -45,12 +45,12 @@ struct sdshdr {
};
static inline size_t sdslen(const sds s) {
- struct sdshdr *sh = (void*)(s-(sizeof(struct sdshdr)));
+ struct sdshdr *sh = (void*)(s-sizeof *sh);
return sh->len;
}
static inline size_t sdsavail(const sds s) {
- struct sdshdr *sh = (void*)(s-(sizeof(struct sdshdr)));
+ struct sdshdr *sh = (void*)(s-sizeof *sh);
return sh->free;
}