From: Kern Sibbald Date: Tue, 3 May 2005 12:59:42 +0000 (+0000) Subject: Fix really ugly bstrncpy() but found by Thorsten. X-Git-Tag: Release-1.38.0~517 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=5dd542cb0b2fc2c460509259edb5a06df35fde45;p=bacula%2Fbacula Fix really ugly bstrncpy() but found by Thorsten. git-svn-id: https://bacula.svn.sourceforge.net/svnroot/bacula/trunk@1981 91ce42f0-d328-0410-95d8-f526ca767f89 --- diff --git a/bacula/src/lib/edit.c b/bacula/src/lib/edit.c index 23fda7737e..21ca18566d 100644 --- a/bacula/src/lib/edit.c +++ b/bacula/src/lib/edit.c @@ -98,7 +98,7 @@ char *edit_uint64_with_commas(uint64_t val, char *buf) val /= 10; } } - bstrncpy(buf, &mbuf[i+1], sizeof(buf)); + bstrncpy(buf, &mbuf[i+1], 27); return add_commas(buf, buf); } @@ -123,7 +123,7 @@ char *edit_uint64(uint64_t val, char *buf) val /= 10; } } - strcpy(buf, &mbuf[i+1]); + bstrncpy(buf, &mbuf[i+1], 27); return buf; } @@ -151,7 +151,7 @@ char *edit_int64(int64_t val, char *buf) if (negative) { mbuf[i--] = '-'; } - strcpy(buf, &mbuf[i+1]); + bstrncpy(buf, &mbuf[i+1], 27); return buf; }