Fix some bugs with how buffer sizes were being calcuated in printbuf_memset and an off-by-one error in printbuf_memappend.
Fix some bugs with how buffer sizes were being calcuated in printbuf_memset and an off-by-one error in printbuf_memappend.

UAVmatrix/json-c,haoranzeus/json-c,alagoutte/json-c,Nzbuu/json-c,PureSwift/json-c,rgerhards/json-c,Nzbuu/json-c,Amineahd/json-c,cubieb/json-c,Nzbuu/json-c,cubieb/json-c,chenha0/json-c,UAVmatrix/json-c,CyanogenMod/android_external_json-c,PureSwift/json-c,rgerhards/json-c,servkey/libjson,chenha0/json-c,PureSwift/json-c,rgerhards/json-c,Distrotech/json-c,CyanogenMod/android_external_json-c,chenha0/json-c,PureSwift/json-c,servkey/libjson,Distrotech/json-c,Distrotech/json-c,UAVmatrix/json-c,CyanogenMod/android_external_json-c,Amineahd/json-c,haoranzeus/json-c,CyanogenMod/android_external_json-c,cubieb/json-c,Nzbuu/json-c,haoranzeus/json-c,colemancda/json-c,Amineahd/json-c,Distrotech/json-c,UAVmatrix/json-c,colemancda/json-c,alagoutte/json-c,colemancda/json-c,servkey/libjson,alagoutte/json-c