commit 2627aa1

uint  ·  2026-07-13 17:08:19 +0000 UTC
parent 27abc16
[update libmaus] using maus_strdup
5 files changed,  +5, -32
+1, -1
1@@ -5,7 +5,7 @@
2    newly allocated string buffer. if NULL, allocation
3    failed or src is NULL
4    note: you must free this newly allocated string */
5-char* strdup(const char* src);
6+char* maus_strdup(const char* src);
7 
8 #endif /* UTIL_H */
9 
+2, -2
 1@@ -369,7 +369,7 @@ void maus_clipboard_set_text(Maus* mw, const char* text)
 2 	}
 3 
 4 	if (text)
 5-		mw->clipboard = strdup(text);
 6+		mw->clipboard = maus_strdup(text);
 7 
 8 	Atom clipboard = XInternAtom(be->display, "CLIPBOARD", False);
 9 	XSetSelectionOwner(be->display, clipboard, be->win, CurrentTime);
10@@ -418,7 +418,7 @@ char* maus_clipboard_get_text(Maus* mw)
11 
12 	char* res = NULL;
13 	if (prop_data) {
14-		res = strdup((char*)prop_data);
15+		res = maus_strdup((char*)prop_data);
16 		XFree(prop_data);
17 	}
18 
+0, -27
 1@@ -1,27 +0,0 @@
 2-#ifndef MAUS_X11_H
 3-#define MAUS_X11_H
 4-
 5-#include <stdbool.h>
 6-
 7-#include <X11/Xlib.h>
 8-#include <X11/extensions/XShm.h>
 9-
10-typedef enum {
11-	MAUS_ATOM_WM_DELETE_WINDOW,
12-	MAUS_ATOM_LAST,
13-} MausX11Atoms;
14-
15-typedef struct {
16-	Display*       display;
17-	Window         root;
18-	Window         win;
19-	Atom           atoms[MAUS_ATOM_LAST];
20-	GC             gc;
21-
22-	XImage*        image;
23-	XShmSegmentInfo shm;
24-	bool           shmat;
25-} MausBackend;
26-
27-#endif /* MAUS_X11_H */
28-
+1, -1
1@@ -3,7 +3,7 @@
2 
3 #include "utils.h"
4 
5-char* strdup(const char* src)
6+char* maus_strdup(const char* src)
7 {
8 	if (src == NULL)
9 		return NULL;
+1, -1
1@@ -5,7 +5,7 @@
2    newly allocated string buffer. if NULL, allocation
3    failed or src is NULL
4    note: you must free this newly allocated string */
5-char* strdup(const char* src);
6+char* maus_strdup(const char* src);
7 
8 #endif /* UTIL_H */
9