From 668e2c52b625e8e55a5155b2f346a811a2e21f43 Mon Sep 17 00:00:00 2001 From: Julia Kitsune Date: Fri, 4 Sep 2026 15:16:28 -0500 Subject: [PATCH] replaced a call to perror with a combination of printf and strerror GNU/Hurd does not define MAXPATHLEN, which was being used to define a buffer that was then passed to perror. I decided that the same functionality could be done by removing the reference to perror by instead calling printf and strerror. This has the effect of removing the need for the buffer using MAXPATHLEN. --- src/paperconf.c | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/src/paperconf.c b/src/paperconf.c index b6d8e38..bfccb3c 100644 --- a/src/paperconf.c +++ b/src/paperconf.c @@ -181,14 +181,8 @@ int main(int argc, char** argv) if (!paper) paper = defaultpapername(); if (!paper) { - char errmsg[2 * MAXPATHLEN + 64]; - sprintf(errmsg, "%s: cannot get system paper size", progname); - - if (errno) - perror(errmsg); - else - fputs(errmsg, stderr); - + fprintf(stderr, "%s: cannot get system paper size: %s\n", progname, + strerror(errno)); paperdone(); exit(3); }