mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: petter wahlman <petter.wahlman@chello.no>
To: perex@suse.cz
Cc: linux-kernel@vger.kernel.org
Subject: [PATCH] linux-2.6.0/sound/core/misc.c - vsnprintf
Date: Mon, 29 Dec 2003 15:20:38 +0100	[thread overview]
Message-ID: <1072707638.927.24.camel@badeip> (raw)

hi,

vsnprintf does not copy more than 'size' bytes _including_ '\0'

-p.


--- linux-2.6.0/sound/core/misc.c       2003-12-18 03:58:38.000000000
+0100
+++ linux-2.6.0-pw/sound/core/misc.c    2003-12-29 14:42:15.000000000
+0100
@@ -51,9 +51,8 @@
                printk("ALSA %s:%d: ", file, line);
        }
        va_start(args, format);
-       vsnprintf(tmpbuf, sizeof(tmpbuf)-1, format, args);
+       vsnprintf(tmpbuf, sizeof(tmpbuf), format, args);
        va_end(args);
-       tmpbuf[sizeof(tmpbuf)-1] = '\0';
        printk(tmpbuf);
 }
 #endif
@@ -73,9 +72,8 @@
                printk(KERN_DEBUG "ALSA %s:%d: ", file, line);
        }
        va_start(args, format);
-       vsnprintf(tmpbuf, sizeof(tmpbuf)-1, format, args);
+       vsnprintf(tmpbuf, sizeof(tmpbuf), format, args);
        va_end(args);
-       tmpbuf[sizeof(tmpbuf)-1] = '\0';
        printk(tmpbuf);

 }



                 reply	other threads:[~2003-12-29 14:20 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1072707638.927.24.camel@badeip \
    --to=petter.wahlman@chello.no \
    --cc=linux-kernel@vger.kernel.org \
    --cc=perex@suse.cz \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®