tReplace sprintf() with snprintf() call - pm - barely a pack manager
(HTM) git clone git://z3bra.org/pm
(DIR) Log
(DIR) Files
(DIR) Refs
(DIR) README
(DIR) LICENSE
---
(DIR) commit 76ec1848a58718b2fba8162c8f3e8695bfe12644
(DIR) parent bbfee43d53ebc2ace9c41c80b6dc30ac3e91b5c6
(HTM) Author: z3bra <contactatz3bradotorg>
Date: Mon, 1 Apr 2019 09:35:04 +0200
Replace sprintf() with snprintf() call
Diffstat:
M pm.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
---
(DIR) diff --git a/pm.c b/pm.c
t@@ -509,7 +509,7 @@ inspect_version(const char *datadir, const char *name, char version[LINE_MAX])
snprintf(tmp, PATH_MAX, "%s/%s/version", datadir, name);
if ((stream = fopen(tmp, "r")) == NULL) {
- sprintf(version, "(unknown)");
+ snprintf(version, 10, "(unknown)");
return 1;
} else {
fgets(version, LINE_MAX, stream);