diff options
author | Johannes Löthberg <johannes@kyriasis.com> | 2015-01-17 23:45:52 +0100 |
---|---|---|
committer | Johannes Löthberg <johannes@kyriasis.com> | 2015-01-17 23:45:52 +0100 |
commit | 1999cc5106e0b98ce3508aa59af98708a281c018 (patch) | |
tree | 19239030000f7551efa7c5fbc81147b42ea2831e /src/sds.h | |
parent | d89b7953c0c3409d8debd3b98430a4d2f5f83fed (diff) | |
download | sds-1999cc5106e0b98ce3508aa59af98708a281c018.tar.xz |
sds.c Replace all in-place calculations with sdsheader
Diffstat (limited to 'src/sds.h')
-rw-r--r-- | src/sds.h | 4 |
1 files changed, 2 insertions, 2 deletions
@@ -46,12 +46,12 @@ static inline struct sdshdr * sdsheader(const sds s) { } static inline size_t sdslen(const sds s) { - struct sdshdr *sh = s - (sizeof (struct sdshdr)); + struct sdshdr *sh = sdsheader(s); return sh->len; } static inline size_t sdsavail(const sds s) { - struct sdshdr *sh = s - (sizeof (struct sdshdr)); + struct sdshdr *sh = sdsheader(s); return sh->free; } |