Last active
May 10, 2016 21:39
-
-
Save garrettr/4e1f54fd5b9f20a365b400441a27b1d7 to your computer and use it in GitHub Desktop.
C: What's wrong with this code?
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
static char* webfp_logfile_path = NULL; | |
static char* | |
get_logfile_path() | |
{ | |
if (!webfp_logfile_path) { | |
char *home_path = getenv("HOME"); | |
char* logfile_path = "/FingerprintSecureDrop/logging/tor_cell_seq.log"; | |
int x = strlen(home_path) + strlen(logfile_path) + 1; | |
char abs_logfile_path[x]; | |
strcpy(abs_logfile_path, home_path); | |
strcat(abs_logfile_path, logfile_path); | |
webfp_logfile_path = abs_logfile_path; | |
} | |
return webfp_logfile_path; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment