changeset 8798:28c0ebfd7a53

[gaim-migrate @ 9560] i'm back, with half the horsepower, and even less overheating :-/ committer: Tailor Script <tailor@pidgin.im>
author Nathan Walp <nwalp@pidgin.im>
date Sat, 24 Apr 2004 15:43:08 +0000
parents 0f2af117d5d3
children 135e295a05bb
files src/proxy.c
diffstat 1 files changed, 6 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/src/proxy.c	Sat Apr 24 14:14:05 2004 +0000
+++ b/src/proxy.c	Sat Apr 24 15:43:08 2004 +0000
@@ -396,7 +396,7 @@
 static void cope_with_gdb_brokenness()
 {
 	static gboolean already_done = FALSE;
-	char s[300], e[300];
+	char s[256], e[512];
 	int n;
 	pid_t ppid;
 
@@ -405,10 +405,13 @@
 		return;
 	already_done = TRUE;
 	ppid = getppid();
-	snprintf(s, 300, "/proc/%d/exe", ppid);
+	snprintf(s, sizeof(s), "/proc/%d/exe", ppid);
 	n = readlink(s, e, sizeof(e));
+	if(n < 0)
+		return;
+
 	e[MIN(n,sizeof(e)-1)] = '\0';
-	
+
 	if(strstr(e,"gdb")) {
 		gaim_debug(GAIM_DEBUG_INFO, "dns",
 				   "Debugger detected, performing useless query...\n");