]> git.saurik.com Git - apt.git/commitdiff
More snprintf stuff
authorArch Librarian <arch@canonical.com>
Mon, 20 Sep 2004 16:57:21 +0000 (16:57 +0000)
committerArch Librarian <arch@canonical.com>
Mon, 20 Sep 2004 16:57:21 +0000 (16:57 +0000)
Author: jgg
Date: 2001-03-23 01:47:14 GMT
More snprintf stuff

apt-pkg/acquire-worker.cc

index 4805b5ebc668749198e8e18af2cba19070c27f55..3b354c9f9e58fb75d2d797a75392b7935f360988 100644 (file)
@@ -1,6 +1,6 @@
 // -*- mode: cpp; mode: fold -*-
 // Description                                                         /*{{{*/
 // -*- mode: cpp; mode: fold -*-
 // Description                                                         /*{{{*/
-// $Id: acquire-worker.cc,v 1.32 2001/02/20 07:03:17 jgg Exp $
+// $Id: acquire-worker.cc,v 1.33 2001/03/23 01:47:14 jgg Exp $
 /* ######################################################################
 
    Acquire Worker 
 /* ######################################################################
 
    Acquire Worker 
@@ -123,8 +123,6 @@ bool pkgAcquire::Worker::Start()
    
    // Fork off the process
    Process = ExecFork();
    
    // Fork off the process
    Process = ExecFork();
-
-   // Spawn the subprocess
    if (Process == 0)
    {
       // Setup the FDs
    if (Process == 0)
    {
       // Setup the FDs
@@ -369,7 +367,7 @@ bool pkgAcquire::Worker::MediaChange(string Message)
                                    LookupTag(Message,"Drive")) == false)
    {
       char S[300];
                                    LookupTag(Message,"Drive")) == false)
    {
       char S[300];
-      sprintf(S,"603 Media Changed\nFailed: true\n\n");
+      snprintf(S,sizeof(S),"603 Media Changed\nFailed: true\n\n");
       if (Debug == true)
         clog << " -> " << Access << ':' << QuoteString(S,"\n") << endl;
       OutQueue += S;
       if (Debug == true)
         clog << " -> " << Access << ':' << QuoteString(S,"\n") << endl;
       OutQueue += S;
@@ -378,7 +376,7 @@ bool pkgAcquire::Worker::MediaChange(string Message)
    }
 
    char S[300];
    }
 
    char S[300];
-   sprintf(S,"603 Media Changed\n\n");
+   snprintf(S,sizeof(S),"603 Media Changed\n\n");
    if (Debug == true)
       clog << " -> " << Access << ':' << QuoteString(S,"\n") << endl;
    OutQueue += S;
    if (Debug == true)
       clog << " -> " << Access << ':' << QuoteString(S,"\n") << endl;
    OutQueue += S;