comparison 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
comparison
equal deleted inserted replaced
9:640f620a55cf 10:1e4ba8d8ffc2
30 #include <dlfcn.h> 30 #include <dlfcn.h>
31 31
32 char* getenvdeb(const char* name) { 32 char* getenvdeb(const char* name) {
33 char tmp[1024] = "IF_QT_"; 33 char tmp[1024] = "IF_QT_";
34 if (strcmp(name, "INTERFACE") == 0) return getenv("IFACE"); 34 if (strcmp(name, "INTERFACE") == 0) return getenv("IFACE");
35 if (strlen(tmp) + strlen(name) >= 1024) { 35 /*if (strlen(tmp) + strlen(name) >= 1024) {
36 fprintf(stderr, "Error: prefixed environment variable name is too long"); 36 fprintf(stderr, "Error: prefixed environment variable name is too long");
37 return NULL; 37 return NULL;
38 } 38 }*/
39 strcat(tmp, name); 39 strncat(tmp, name, 1024 - 6 - 1);
40 return getenv(tmp); 40 return getenv(tmp);
41 } 41 }
42 42
43 int main() { 43 int main() {
44 /* Header */ 44 /* Header */