shithub: orca

Download patch

ref: eea0bd91a2fa44b27ca0d7c1fffb5831335a9b49
parent: ed44a599a31562d5369a721cc8392cb6caa52e9d
author: Sigrid Solveig Haflínudóttir <sigrid@ftrv.se>
date: Fri Apr 4 17:22:33 EDT 2025

fix a few warnings

--- a/plan9.c
+++ b/plan9.c
@@ -1256,8 +1256,7 @@
 	Rune r;
 	Mouse m;
 	Point p;
-	char tmp[256];
-	char cmd[256];
+	char tmp[256], cmd[256], *s;
 	int oldw, oldh, w, h, n, oldbuttons, themetid;
 	long seed;
 	bool complete;
@@ -1305,8 +1304,9 @@
 		srand(seed);
 		break;
 	case 'c':
-		if (chartorune(&cursor, EARGF(usage())) < 1 || cursor == Runeerror) {
-			fprint(2, "invalid cursor \"%s\"\n", EARGF(usage()));
+		s = EARGF(usage());
+		if (chartorune(&cursor, s) < 1 || cursor == Runeerror) {
+			fprint(2, "invalid cursor \"%s\"\n", s);
 			threadexitsall("args");
 		}
 		break;
@@ -1323,8 +1323,9 @@
 		midipath = EARGF(usage());
 		break;
 	case 'l':
-		if ((maxsnaps = atoi(EARGF(usage()))) < 0) {
-			fprint(2, "invalid undo limit %s\n", EARGF(usage()));
+		s = EARGF(usage());
+		if ((maxsnaps = atoi(s)) < 0) {
+			fprint(2, "invalid undo limit %s\n", s);
 			threadexitsall("args");
 		}
 		break;