From aa25c02661cf10154b1a19e6f197c9ff2f3223c5 Mon Sep 17 00:00:00 2001 From: Victor Fernandes Date: Mon, 13 Feb 2017 18:39:58 -0500 Subject: [PATCH] .gitignore: add VS-related project files buffer.c: allow start from zero capacity (still works!) --- .gitignore | 6 +++++- buffer.c | 3 +-- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/.gitignore b/.gitignore index a4f9661..ca654ac 100644 --- a/.gitignore +++ b/.gitignore @@ -39,4 +39,8 @@ bld/ *.a *.o *.out -*.gch \ No newline at end of file +*.gch +*.vcxproj +*.filters +*.db +*.opendb diff --git a/buffer.c b/buffer.c index f577735..3c214a0 100644 --- a/buffer.c +++ b/buffer.c @@ -36,7 +36,7 @@ Buffer* b_create(short init_capacity, char inc_factor, char o_mode) { /* BEGIN CONFIGURING BUFFER */ /* Check if init_capacity is within acceptable range */ - if (init_capacity <= ZERO_CAPACITY) { + if (init_capacity < ZERO_CAPACITY) { return NULL; } /* Leaving cb_head allocation for last in the event of bad input */ @@ -332,7 +332,6 @@ pBuffer b_addc(pBuffer const pBD, char symbol) { * returning the character. */ char b_getc(Buffer* const pBD) { - char char_buf; if (!pBD) { return R_FAIL2; } /* Make sure the buffer isn't at the end of the read offset*/