From c74be209a31eab601239799fc4a745a83c8d8dd7 Mon Sep 17 00:00:00 2001 From: Yehuda Sadeh Date: Fri, 15 Jan 2010 10:33:57 -0800 Subject: [PATCH] replace strcat with strncat --- src/common/debug.cc | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/common/debug.cc b/src/common/debug.cc index 8a45320a3354f..10d804bf212b9 100644 --- a/src/common/debug.cc +++ b/src/common/debug.cc @@ -41,9 +41,9 @@ void _dout_open_log() if (g_conf.log_dir[0] == '/') strcpy(_dout_dir, g_conf.log_dir); else { - getcwd(_dout_dir, 100); - strcat(_dout_dir, "/"); - strcat(_dout_dir, g_conf.log_dir); + getcwd(_dout_dir, sizeof(_dout_dir)); + strncat(_dout_dir, "/", sizeof(_dout_dir)); + strncat(_dout_dir, g_conf.log_dir, sizeof(_dout_dir)); } if (!g_conf.log_sym_dir) @@ -52,9 +52,9 @@ void _dout_open_log() if (g_conf.log_sym_dir[0] == '/') strcpy(_dout_symlink_dir, g_conf.log_sym_dir); else { - getcwd(_dout_symlink_dir, 100); - strcat(_dout_symlink_dir, "/"); - strcat(_dout_symlink_dir, g_conf.log_sym_dir); + getcwd(_dout_symlink_dir, sizeof(_dout_symlink_dir)); + strncat(_dout_symlink_dir, "/", sizeof(_dout_symlink_dir)); + strncat(_dout_symlink_dir, g_conf.log_sym_dir, sizeof(_dout_symlink_dir)); } // make symlink target absolute or relative? -- 2.39.5