zsh-workers
 help / color / mirror / code / Atom feed
From: "Andrej Borsenkow" <Andrej.Borsenkow@mow.siemens.ru>
To: "Clint Adams" <schizo@debian.org>, <zsh-workers@sunsite.auc.dk>
Subject: RE: PATCH: zasprintf
Date: Mon, 18 Sep 2000 17:28:06 +0400	[thread overview]
Message-ID: <000001c02174$47adf680$21c9ca95@mow.siemens.ru> (raw)
In-Reply-To: <20000916145333.A29559@dman.com>

> +
> +    *strp = buf;
> +    return strlen(buf);


It is wrong IIRC in case of (v|)snprintf. snprintf may leave buffer not
NULL-terminated in case of overflow. Even worse is, that there seems to be no
standard return value to indicate overflow (some systems return -1; some
buffer length. There was very interesting comment from Mark Crispin on
c-client list recently). And some systems (mine including) do not even
document snprintf.

Somehow I agree with Bart - if we can avoid it, let's avoid it.

-andrej


      parent reply	other threads:[~2000-09-18 13:28 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2000-09-16 18:53 Clint Adams
2000-09-17  0:47 ` Bart Schaefer
2000-09-17  1:10   ` PATH_MAX again Bart Schaefer
2000-09-17  4:25   ` PATCH: zasprintf Clint Adams
2000-09-17  5:37     ` Bart Schaefer
2000-09-17 15:04       ` Clint Adams
2000-09-17 16:13         ` Bart Schaefer
2000-09-17 16:43           ` Clint Adams
2000-09-17 12:21   ` Zefram
2000-09-18 13:28 ` Andrej Borsenkow [this message]

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='000001c02174$47adf680$21c9ca95@mow.siemens.ru' \
    --to=andrej.borsenkow@mow.siemens.ru \
    --cc=schizo@debian.org \
    --cc=zsh-workers@sunsite.auc.dk \
    /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.
Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).