diff options
author | Johannes Löthberg <johannes@kyriasis.com> | 2015-01-17 23:32:08 +0100 |
---|---|---|
committer | Johannes Löthberg <johannes@kyriasis.com> | 2015-01-17 23:32:08 +0100 |
commit | 42b94c089c97b7f8d41ace2af5a90c161c1815f9 (patch) | |
tree | b3c6e63d1ffba9f1c536f1131556406a742dc33f /src/sds.h | |
parent | 88cd9a624427dcf030f68f835525e49948e60ed5 (diff) | |
download | sds-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.h | 4 |
1 files changed, 2 insertions, 2 deletions
@@ -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; } |