]> git.ipfire.org Git - thirdparty/cups.git/blobdiff - scheduler/statbuf.c
Load cups into easysw/current.
[thirdparty/cups.git] / scheduler / statbuf.c
index eedec49c316f599e5a9cc7c3bbc601aa33ff1a0a..0450fa14a854f607a3ea7aa68b16605ab6c7d0ff 100644 (file)
@@ -1,10 +1,10 @@
 /*
- * "$Id: statbuf.c 4719 2005-09-28 21:12:44Z mike $"
+ * "$Id: statbuf.c 5888 2006-08-24 21:42:47Z mike $"
  *
  *   Status buffer routines for the Common UNIX Printing System (CUPS)
  *   scheduler.
  *
- *   Copyright 1997-2005 by Easy Software Products, all rights reserved.
+ *   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
@@ -193,7 +193,7 @@ cupsdStatBufUpdate(cupsd_statbuf_t *sb,     /* I - Status buffer */
       lineptr = NULL;
   }
 
-  if (lineptr == NULL)
+  if (!lineptr)
   {
    /*
     * End of file...
@@ -304,6 +304,8 @@ cupsdStatBufUpdate(cupsd_statbuf_t *sb,     /* I - Status buffer */
     else
       cupsdLogMessage(*loglevel, "%s %s", sb->prefix, message);
   }
+  else if (*loglevel < CUPSD_LOG_NONE && LogLevel == CUPSD_LOG_DEBUG2)
+    cupsdLogMessage(CUPSD_LOG_DEBUG2, "%s %s", sb->prefix, sb->buffer);
 
  /*
   * Copy the message to the line buffer...
@@ -315,7 +317,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)
@@ -326,5 +330,5 @@ cupsdStatBufUpdate(cupsd_statbuf_t *sb,     /* I - Status buffer */
 
 
 /*
- * End of "$Id: statbuf.c 4719 2005-09-28 21:12:44Z mike $".
+ * End of "$Id: statbuf.c 5888 2006-08-24 21:42:47Z mike $".
  */