remove some warnings in unit tests

catch impossible buffer in bs_init_membuf
This commit is contained in:
leitner
2020-10-30 15:06:17 +00:00
parent 7ce1c93d0f
commit 4f66a05d0b
10 changed files with 27 additions and 12 deletions

View File

@@ -46,7 +46,7 @@ size_t scan_base64(const char *src,char *dest,size_t *destlen) {
int main() {
char buf[100];
size_t i,l;
size_t l;
memset(buf,0,10); assert(scan_base64("Zm5vcmQ=",buf,&l)==8 && l==5 && !memcmp(buf,"fnord",6));
/* check that we don't insist on the padding */
memset(buf,0,10); assert(scan_base64("Zm5vcmQ",buf,&l)==7 && l==5 && !memcmp(buf,"fnord",6));

View File

@@ -38,7 +38,7 @@ size_t scan_base64url(const char *src,char *dest,size_t *destlen) {
int main() {
char buf[100];
size_t i,l;
size_t l;
/* check that we don't consume padding */
memset(buf,0,10); assert(scan_base64url("Zm5vcmQ=",buf,&l)==7 && l==5 && !memcmp(buf,"fnord",6));
/* check that we don't insist on the padding */