From 7f25bdff3a0fa55ba897964d5c82475b45f3325a Mon Sep 17 00:00:00 2001 From: Arch Librarian Date: Mon, 20 Sep 2004 16:52:26 +0000 Subject: Dsync merge Author: jgg Date: 1999-01-18 06:20:07 GMT Dsync merge --- apt-pkg/contrib/error.cc | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) (limited to 'apt-pkg/contrib/error.cc') diff --git a/apt-pkg/contrib/error.cc b/apt-pkg/contrib/error.cc index bbd081d50..8ae2686de 100644 --- a/apt-pkg/contrib/error.cc +++ b/apt-pkg/contrib/error.cc @@ -1,6 +1,6 @@ // -*- mode: cpp; mode: fold -*- // Description /*{{{*/ -// $Id: error.cc,v 1.5 1998/09/18 02:42:40 jgg Exp $ +// $Id: error.cc,v 1.6 1999/01/18 06:20:07 jgg Exp $ /* ###################################################################### Global Erorr Class - Global error mechanism @@ -80,8 +80,9 @@ bool GlobalError::Errno(const char *Function,const char *Description,...) // sprintf the description char S[400]; - vsprintf(S,Description,args); - sprintf(S + strlen(S)," - %s (%i %s)",Function,errno,strerror(errno)); + vsnprintf(S,sizeof(S),Description,args); + snprintf(S + strlen(S),sizeof(S) - strlen(S), + " - %s (%i %s)",Function,errno,strerror(errno)); // Put it on the list Item *Itm = new Item; @@ -108,8 +109,8 @@ bool GlobalError::WarningE(const char *Function,const char *Description,...) // sprintf the description char S[400]; - vsprintf(S,Description,args); - sprintf(S + strlen(S)," - %s (%i %s)",Function,errno,strerror(errno)); + vsnprintf(S,sizeof(S),Description,args); + snprintf(S + strlen(S),sizeof(S) - strlen(S)," - %s (%i %s)",Function,errno,strerror(errno)); // Put it on the list Item *Itm = new Item; @@ -130,7 +131,7 @@ bool GlobalError::Error(const char *Description,...) // sprintf the description char S[400]; - vsprintf(S,Description,args); + vsnprintf(S,sizeof(S),Description,args); // Put it on the list Item *Itm = new Item; @@ -153,7 +154,7 @@ bool GlobalError::Warning(const char *Description,...) // sprintf the description char S[400]; - vsprintf(S,Description,args); + vsnprintf(S,sizeof(S),Description,args); // Put it on the list Item *Itm = new Item; -- cgit v1.2.3