cu coredumps

Mark Cullen mark.cullen at dsl.pipex.com
Wed Oct 27 09:17:20 PDT 2004


Anyway, (attempt at a) patch below. I think I made a bit of a mess of 
the whole strlen stuff maybe. Not too sure about that..

Thanks

Sorry, would have been better to attach the patch as a file I think, to 
preserve tabs and such. Whoops. I'll get there in the end!

See attached.
--
Internet Explorer? Try FireFox at http://www.mozilla.org/products/firefox/
Outlook Express? Try ThunderBird at 
http://www.mozilla.org/products/thunderbird/
--- hunt.c.old	2004-10-27 16:44:06.000000000 +0100
+++ hunt.c	2004-10-27 17:12:57.000000000 +0100
@@ -58,17 +58,31 @@
 hunt(name)
 	char *name;
 {
-	register char *cp;
+	register char *cp, *tmp_cp;
 	sig_t f;
-	int res;
+	int res, cp_len = 0;
 
 	f = signal(SIGALRM, dead);
 	while ((cp = getremote(name))) {
 		deadfl = 0;
-		if ((uucplock = strrchr(cp, '/')) == NULL)
-			uucplock = cp;
-		else
+
+		cp_len = strlen(cp) + strlen("/dev/") + 1;
+		tmp_cp = malloc(sizeof(char) * cp_len);
+
+		if ((uucplock = strrchr(cp, '/')) == NULL) {
+			strncpy(tmp_cp, "/dev/", 6);
+			strncat(tmp_cp, cp, strlen(cp));
+			cp = tmp_cp;
+
+			if ((uucplock = strrchr(cp, '/')) == NULL) {
+				uucplock = cp;
+			} else {
+				++uucplock;
+			}
+		} else {
 			++uucplock;
+		}
+
 		if ((res = uu_lock(uucplock)) != UU_LOCK_OK) {
 			if (res != UU_LOCK_INUSE)
 				fprintf(stderr, "uu_lock: %s\n", uu_lockerr(res));




More information about the Bugs mailing list