From 42b94c089c97b7f8d41ace2af5a90c161c1815f9 Mon Sep 17 00:00:00 2001 From: Johannes Löthberg Date: Sat, 17 Jan 2015 23:32:08 +0100 Subject: 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. --- src/sds.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/sds.h') 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; } -- cgit v1.2.3-54-g00ecf