Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/moses-smt/giza-pp.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorredpony <redpony@ca354974-eb3a-0410-8f5c-d3948404989b>2012-12-19 09:05:35 +0400
committerredpony <redpony@ca354974-eb3a-0410-8f5c-d3948404989b>2012-12-19 09:05:35 +0400
commit7bcb9b59cf6613dd9ce7c10a743586e9233c7aa5 (patch)
tree072adb0f4cf8c107369bb668f5840ecbdd962dce
parente96a851fb31e043af0446e13185138f647d0e666 (diff)
fix for no user on some OSs
-rw-r--r--GIZA++-v2/file_spec.h3
1 files changed, 2 insertions, 1 deletions
diff --git a/GIZA++-v2/file_spec.h b/GIZA++-v2/file_spec.h
index 2d43295..a8a1630 100644
--- a/GIZA++-v2/file_spec.h
+++ b/GIZA++-v2/file_spec.h
@@ -36,7 +36,7 @@ USA.
char *Get_File_Spec (){
struct tm *local;
time_t t;
- char *user;
+ const char *user;
char time_stmp[19];
char *file_spec = 0;
@@ -47,6 +47,7 @@ char *Get_File_Spec (){
(local->tm_mon + 1), local->tm_mday, local->tm_hour,
local->tm_min, local->tm_sec);
user = getenv("USER");
+ if (!user) { user = "no_user"; }
file_spec = (char *)malloc(sizeof(char) *
(strlen(time_stmp) + strlen(user) + 1));