]> git.ipfire.org Git - thirdparty/cups.git/blobdiff - scheduler/statbuf.c
Merge changes from CUPS 1.3.1.
[thirdparty/cups.git] / scheduler / statbuf.c
index a4875b1c227207182810d04ced9274c92687dd7a..699a5c8b0bdf765a35338578ceaf4d267947076a 100644 (file)
@@ -1,26 +1,17 @@
 /*
- * "$Id: statbuf.c 5073 2006-02-04 17:39:51Z mike $"
+ * "$Id: statbuf.c 6649 2007-07-11 21:46:42Z mike $"
  *
  *   Status buffer routines for the Common UNIX Printing System (CUPS)
  *   scheduler.
  *
+ *   Copyright 2007 by Apple Inc.
  *   Copyright 1997-2006 by Easy Software Products, all rights reserved.
  *
  *   These coded instructions, statements, and computer programs are the
- *   property of Easy Software Products and are protected by Federal
- *   copyright law.  Distribution and use rights are outlined in the file
- *   "LICENSE.txt" which should have been included with this file.  If this
- *   file is missing or damaged please contact Easy Software Products
- *   at:
- *
- *       Attn: CUPS Licensing Information
- *       Easy Software Products
- *       44141 Airport View Drive, Suite 204
- *       Hollywood, Maryland 20636 USA
- *
- *       Voice: (301) 373-9600
- *       EMail: cups-info@cups.org
- *         WWW: http://www.cups.org
+ *   property of Apple Inc. and are protected by Federal copyright
+ *   law.  Distribution and use rights are outlined in the file "LICENSE.txt"
+ *   which should have been included with this file.  If this file is
+ *   file is missing or damaged, see the license at "http://www.cups.org/".
  *
  * Contents:
  *
@@ -193,7 +184,7 @@ cupsdStatBufUpdate(cupsd_statbuf_t *sb,     /* I - Status buffer */
       lineptr = NULL;
   }
 
-  if (lineptr == NULL)
+  if (!lineptr)
   {
    /*
     * End of file...
@@ -277,7 +268,7 @@ cupsdStatBufUpdate(cupsd_statbuf_t *sb,     /* I - Status buffer */
   }
   else
   {
-    *loglevel = CUPSD_LOG_ERROR;
+    *loglevel = CUPSD_LOG_DEBUG;
     message   = sb->buffer;
   }
 
@@ -317,7 +308,9 @@ cupsdStatBufUpdate(cupsd_statbuf_t *sb,     /* I - Status buffer */
   * Copy over the buffer data we've used up...
   */
 
-  _cups_strcpy(sb->buffer, lineptr);
+  if (lineptr < sb->buffer + sb->bufused)
+    _cups_strcpy(sb->buffer, lineptr);
+
   sb->bufused -= lineptr - sb->buffer;
 
   if (sb->bufused < 0)
@@ -328,5 +321,5 @@ cupsdStatBufUpdate(cupsd_statbuf_t *sb,     /* I - Status buffer */
 
 
 /*
- * End of "$Id: statbuf.c 5073 2006-02-04 17:39:51Z mike $".
+ * End of "$Id: statbuf.c 6649 2007-07-11 21:46:42Z mike $".
  */