about summary refs log tree commit diff
diff options
context:
space:
mode:
authorJune McEnroe <june@causal.agency>2018-08-06 22:08:57 -0400
committerJune McEnroe <june@causal.agency>2018-08-06 22:08:57 -0400
commit1c2b0383960f99f1f9ad88e552588f361040b872 (patch)
tree546e8e0c0cb383e9cea1e57d828a23ed9d03c80b
parentImplement word wrapping (diff)
downloadcatgirl-1c2b0383960f99f1f9ad88e552588f361040b872.tar.gz
catgirl-1c2b0383960f99f1f9ad88e552588f361040b872.zip
Fix allocation size in vaswprintf
This is so embarrassing. It only started crashing once it had strings
that were long enough, and then it took me so long to notice this
mistake. I was worried I was still doing va_list wrong somehow.
-rw-r--r--pls.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/pls.c b/pls.c
index c6071c7..7e6570c 100644
--- a/pls.c
+++ b/pls.c
@@ -47,7 +47,7 @@ int vaswprintf(wchar_t **ret, const wchar_t *format, va_list ap) {
 	*ret = NULL;
 
 	for (size_t cap = 2 * wcslen(format);; cap *= 2) {
-		wchar_t *buf = realloc(*ret, 1 + cap);
+		wchar_t *buf = realloc(*ret, sizeof(*buf) * (1 + cap));
 		if (!buf) goto fail;
 		*ret = buf;
 
/www/causal.agency/index.html.in?id=d34bd30ccf77d33d8bb805e6b4ae8bd667c829ec&follow=1'>Collapse simple linksJune McEnroe 2020-02-12Move catgirl up the pageJune McEnroe 2020-02-12Update catgirl pty grabJune McEnroe 2020-02-12Link to cgit /about pages where appropriateJune McEnroe 2020-02-11Separate LINKS from BINS for html to workJune McEnroe 2020-02-11Add margin to Bl-bullet itemsJune McEnroe 2020-02-10Match URLs inside parens or with paired parens insideJune McEnroe 2020-02-10Duplicate effective URL before passing it back to curlJune McEnroe 2020-02-09Add To Be Taught, If FortunateJune McEnroe 2020-02-04Add The Future of Another TimelineJune McEnroe 2020-01-31Reorganize the Makefile for the umpteenth timeJune McEnroe 2020-01-28Change scout sensitivity to 1.4June McEnroe 2020-01-28Import shows.txtJune McEnroe