summaryrefslogtreecommitdiffhomepage
path: root/src/demorec.c
diff options
context:
space:
mode:
authorMichael Smith <mikesmiffy128@gmail.com>2023-01-14 21:58:26 +0000
committerMichael Smith <mikesmiffy128@gmail.com>2023-01-15 15:17:51 +0000
commit3e4c26eeb701d96aa73bd482d48140f229cd9079 (patch)
treee476b3c257e463c91684aecfbd8cb3e35af0fbbb /src/demorec.c
parentfac74801bc7a1c08fa04b6e98de24604c53a9bbb (diff)
Fix a sizeof blunder I happened to notice recently
Nobody seems to have been affected by this in the wild yet, thank goodness. Will probably be a while before there's an actual release, so hopefully people will continue not to be affected. I suppose it's only an issue for paths longer than 128 characters, so it's not too likely to matter under normal circumstances...
Diffstat (limited to 'src/demorec.c')
-rw-r--r--src/demorec.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/demorec.c b/src/demorec.c
index 4434534..307e751 100644
--- a/src/demorec.c
+++ b/src/demorec.c
@@ -1,6 +1,6 @@
/*
* Copyright © 2021 Willian Henrique <wsimanbrazil@yahoo.com.br>
- * Copyright © 2022 Michael Smith <mikesmiffy128@gmail.com>
+ * Copyright © 2023 Michael Smith <mikesmiffy128@gmail.com>
*
* Permission to use, copy, modify, and/or distribute this software for any
* purpose with or without fee is hereby granted, provided that the above
@@ -107,7 +107,7 @@ static void hook_record_cb(const struct con_cmdargs *args) {
int gdlen = os_strlen(gameinfo_gamedir);
if (gdlen + 1 + argdirlen < PATH_MAX) { // if not, too bad
os_char dir[PATH_MAX], *q = dir;
- memcpy(q, gameinfo_gamedir, gdlen * sizeof(gameinfo_gamedir));
+ memcpy(q, gameinfo_gamedir, gdlen * sizeof(*gameinfo_gamedir));
q += gdlen;
*q++ = OS_LIT('/');
// ascii->wtf16 (probably turns into memcpy() on linux)