diff src/run.debian.c @ 10:1e4ba8d8ffc2

Use strncat, fixed nacltai timestamp check
author Ivo Smits <Ivo@UCIS.nl>
date Sat, 04 Dec 2010 03:01:46 +0100
parents 65c01f57bdce
children
line wrap: on
line diff
--- a/src/run.debian.c	Wed Oct 20 21:08:03 2010 +0200
+++ b/src/run.debian.c	Sat Dec 04 03:01:46 2010 +0100
@@ -32,11 +32,11 @@
 char* getenvdeb(const char* name) {
 	char tmp[1024] = "IF_QT_";
 	if (strcmp(name, "INTERFACE") == 0) return getenv("IFACE");
-	if (strlen(tmp) + strlen(name) >= 1024) {
+	/*if (strlen(tmp) + strlen(name) >= 1024) {
 		fprintf(stderr, "Error: prefixed environment variable name is too long");
 		return NULL;
-	}
-	strcat(tmp, name);
+	}*/
+	strncat(tmp, name, 1024 - 6 - 1);
 	return getenv(tmp);
 }
 
@@ -70,4 +70,4 @@
 
 	*getconfig = (void*)getenvdeb;
 	((void (*)())tunmain)();
-}
\ No newline at end of file
+}