summaryrefslogtreecommitdiff
path: root/apt-pkg/contrib/error.cc
diff options
context:
space:
mode:
authorArch Librarian <arch@canonical.com>2004-09-20 16:52:26 +0000
committerArch Librarian <arch@canonical.com>2004-09-20 16:52:26 +0000
commit7f25bdff3a0fa55ba897964d5c82475b45f3325a (patch)
tree7190f1448161be6bfd163cdd88efee6101e1ae8c /apt-pkg/contrib/error.cc
parenta9975068c7d55b2fbe46aacf94a36b460fd1d9da (diff)
Dsync merge
Author: jgg Date: 1999-01-18 06:20:07 GMT Dsync merge
Diffstat (limited to 'apt-pkg/contrib/error.cc')
-rw-r--r--apt-pkg/contrib/error.cc15
1 files changed, 8 insertions, 7 deletions
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;