Add big comment why we need strlcat everywhere. - geomyidae - a small C-based g… | |
git clone git://git.codemadness.org/geomyidae | |
Log | |
Files | |
Refs | |
README | |
LICENSE | |
--- | |
commit 60b382884e98afcc7e8dc4b679094ef2a1c652fa | |
parent 96c7692574c9f7edf5faf5c98cafb8473b0fc1ce | |
Author: Christoph Lohmann <[email protected]> | |
Date: Thu, 10 Aug 2023 11:51:56 +0200 | |
Add big comment why we need strlcat everywhere. | |
Diffstat: | |
M main.c | 11 +++++++++++ | |
1 file changed, 11 insertions(+), 0 deletions(-) | |
--- | |
diff --git a/main.c b/main.c | |
@@ -356,6 +356,17 @@ dothegopher: | |
} | |
return; | |
} | |
+ /* | |
+ * The size check for strcat to work is | |
+ * above. | |
+ * | |
+ * Until strlcat isn't properly in all | |
+ * linux libcs, we keep to this. OpenBSD | |
+ * will complain about strcat and | |
+ * smart-ass gcc will cmplain about | |
+ * strncat of one char static char array | |
+ * is an overflow. | |
+ */ | |
if (rpath[len-1] != '/') | |
strcat(rpath, "/"); | |
strcat(rpath, indexf[i]); |