openbsd-ports/x11/xpostit/patches/patch-util_c
naddy b5ee94956f x11/xpostit: explicitly cast integer to pointer to fix build with clang 15
The callback takes a pointer to be able to pass arbitrary data, but
instead of allocating an int and passing a pointer to it, the code
jams the int directly into the pointer for an int -> pointer -> int
roundtrip.  Problem reported by and discussed with jca@.

Fix implicit function declarations.
2023-01-29 00:07:55 +00:00

32 lines
605 B
Plaintext

Index: util.c
--- util.c.orig
+++ util.c
@@ -44,8 +44,10 @@ static char *RCSid = "$Header: /home/harbor/davy/stuff
#include <X11/StringDefs.h>
#include <X11/Intrinsic.h>
#include <sys/param.h>
-#include <stdio.h>
#include <pwd.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <unistd.h>
#include "xpostit.h"
@@ -72,7 +74,6 @@ ByeBye()
void
SetNoteDir()
{
- char *getenv();
char *home, *s;
struct passwd *pwd;
char fname[MAXPATHLEN];
@@ -129,7 +130,6 @@ char *
SafeAlloc(nbytes)
register int nbytes;
{
- char *malloc();
register char *s;
if ((s = malloc(nbytes)) == NULL) {