summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlan Coopersmith <alan.coopersmith@oracle.com>2023-01-28 10:12:58 -0800
committerAlan Coopersmith <alan.coopersmith@oracle.com>2023-01-28 10:13:02 -0800
commitffbfe65382c8f267139b87630976700c0e80b435 (patch)
tree6a2312f71266c006efb557a0817ca5c33e4d0aaf
parent7862d8d80e8612b3e7285ce2fe3ec901fda05fe6 (diff)
Use XtAsprintf instead of manual mallocing and copying of strings
Raises minimum libXt requirement to 1.1.0 Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
-rw-r--r--Mailbox.c10
-rw-r--r--configure.ac2
2 files changed, 4 insertions, 8 deletions
diff --git a/Mailbox.c b/Mailbox.c
index 9a592dd..02f28f0 100644
--- a/Mailbox.c
+++ b/Mailbox.c
@@ -545,14 +545,10 @@ static void GetMailFile (MailboxWidget w)
}
#endif
if ((mailpath = getenv("MAIL"))) {
- w->mailbox.filename = XtMalloc (strlen (mailpath) + 1);
- strcpy (w->mailbox.filename, mailpath);
+ XtAsprintf(&w->mailbox.filename, "%s", mailpath);
} else {
- w->mailbox.filename = XtMalloc (strlen (MAILBOX_DIRECTORY) + 1
- + strlen (username) + 1);
- strcpy (w->mailbox.filename, MAILBOX_DIRECTORY);
- strcat (w->mailbox.filename, "/");
- strcat (w->mailbox.filename, username);
+ XtAsprintf(&w->mailbox.filename, "%s/%s",
+ MAILBOX_DIRECTORY, username);
}
return;
}
diff --git a/configure.ac b/configure.ac
index dd8cbff..9e4ac37 100644
--- a/configure.ac
+++ b/configure.ac
@@ -38,7 +38,7 @@ XORG_MACROS_VERSION(1.8)
XORG_DEFAULT_OPTIONS
# Checks for pkg-config packages
-PKG_CHECK_MODULES(XBIFF, xaw7 xmu xbitmaps xext x11)
+PKG_CHECK_MODULES(XBIFF, [xaw7 xmu xt >= 1.1 xbitmaps xext x11])
# Checks for headers
AC_CHECK_HEADERS([paths.h])