aboutsummaryrefslogtreecommitdiffstats
path: root/src/sds.h
diff options
context:
space:
mode:
authorJohannes Löthberg <johannes@kyriasis.com>2015-01-17 23:32:08 +0100
committerJohannes Löthberg <johannes@kyriasis.com>2015-01-17 23:32:08 +0100
commit42b94c089c97b7f8d41ace2af5a90c161c1815f9 (patch)
treeb3c6e63d1ffba9f1c536f1131556406a742dc33f /src/sds.h
parent88cd9a624427dcf030f68f835525e49948e60ed5 (diff)
downloadsds-42b94c089c97b7f8d41ace2af5a90c161c1815f9.tar.xz
Revert "SDS Header pointer math rewritten in a more elegant form."
This reverts commit c636fc6cd25e455a75dca24ac08ba736f62db6c8. This commit was just utterly senseless, all it does is make the code less clear for literally nothing.
Diffstat (limited to 'src/sds.h')
-rw-r--r--src/sds.h4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/sds.h b/src/sds.h
index 5080495..98124a5 100644
--- a/src/sds.h
+++ b/src/sds.h
@@ -42,12 +42,12 @@ struct sdshdr {
};
static inline size_t sdslen(const sds s) {
- struct sdshdr *sh = (void*)(s-sizeof *sh);
+ struct sdshdr *sh = (void*)(s-(sizeof(struct sdshdr)));
return sh->len;
}
static inline size_t sdsavail(const sds s) {
- struct sdshdr *sh = (void*)(s-sizeof *sh);
+ struct sdshdr *sh = (void*)(s-(sizeof(struct sdshdr)));
return sh->free;
}