Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.c > #60393

Re: Please critique my strdupf library

From Ben Bacarisse <ben.usenet@bsb.me.uk>
Newsgroups comp.lang.c
Subject Re: Please critique my strdupf library
Date 2015-04-19 13:32 +0100
Organization A noiseless patient Spider
Message-ID <87y4lo8fjt.fsf@bsb.me.uk> (permalink)
References <6df1a933-2ba8-41f6-a169-f622244f0b66@googlegroups.com> <mh03am$lt1$1@news.albasani.net>

Show all headers | View raw


Johannes Bauer <dfnsonfsduifb@gmx.de> writes:

> On 19.04.2015 10:34, samuelallenalexander@gmail.com wrote:

(Aside: did you know you can put .s in gmail addresses without altering
the account to which they refer?  All of abc@gmail.com, a.bc@gmail.com
and a.b.c@gmail.com refer to the same account.)

>> Is there anything you can see that would further improve the library?
>
> No real help here but a comment: I found your use of vsnprintf rather
> clever in the way you use it within strlenf. Didn't know that it returns
> the number of non-printable characters, but I do now :-)

Yes, that's neat, but I found the comment in the code rather unclear.
It says, much like you summary here, that "vsnprintf returns the number
of chars that could not be printed due to size limit".  That's not
literally true (but it made me go check because it sounds so
authoritative!)  vsnprintf returns the number of character that would
need to be printed to do the job, which, if you pass 0 as the buffer
size, does indeed become the number of characters that could not be
printed.

(I hope you won't mind a language correction: the pharse "non-printable
characters" would refer to those with some property -- that of being
inherently non-printable -- not to those that are not printed in some
specific situation.  One could say "the number of not-printed
characters" or, more comfortably, "the number of characters not printed".)

-- 
Ben.

Back to comp.lang.c | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread


Thread

Please critique my strdupf library samuelallenalexander@gmail.com - 2015-04-19 01:34 -0700
  Re: Please critique my strdupf library Ian Collins <ian-news@hotmail.com> - 2015-04-19 20:46 +1200
    Re: Please critique my strdupf library samuelallenalexander@gmail.com - 2015-04-19 02:25 -0700
      Re: Please critique my strdupf library Ian Collins <ian-news@hotmail.com> - 2015-04-19 21:35 +1200
        Re: Please critique my strdupf library Keith Thompson <kst-u@mib.org> - 2015-04-19 07:44 -0700
          Re: Please critique my strdupf library samuelallenalexander@gmail.com - 2015-04-19 10:23 -0700
            Re: Please critique my strdupf library Morris Dovey <mrdovey@iedu.com> - 2015-04-19 13:09 -0500
      Re: Please critique my strdupf library fir <profesor.fir@gmail.com> - 2015-04-19 02:48 -0700
        Re: Please critique my strdupf library samuelallenalexander@gmail.com - 2015-04-19 03:42 -0700
  Re: Please critique my strdupf library fir <profesor.fir@gmail.com> - 2015-04-19 02:11 -0700
  Re: Please critique my strdupf library Ben Bacarisse <ben.usenet@bsb.me.uk> - 2015-04-19 11:11 +0100
    Re: Please critique my strdupf library samuelallenalexander@gmail.com - 2015-04-19 04:36 -0700
      Re: Please critique my strdupf library Johannes Bauer <dfnsonfsduifb@gmx.de> - 2015-04-19 15:41 +0200
        Re: Please critique my strdupf library samuelallenalexander@gmail.com - 2015-04-19 07:28 -0700
  Re: Please critique my strdupf library August Karlstrom <fusionfile@gmail.com> - 2015-04-19 12:12 +0200
  Re: Please critique my strdupf library Johannes Bauer <dfnsonfsduifb@gmx.de> - 2015-04-19 13:25 +0200
    Re: Please critique my strdupf library Ben Bacarisse <ben.usenet@bsb.me.uk> - 2015-04-19 13:32 +0100
  Re: Please critique my strdupf library Lőrinczy Zsigmond <nospam@for.me> - 2015-04-19 16:29 +0200
  Re: Please critique my strdupf library Keith Thompson <kst-u@mib.org> - 2015-04-19 07:52 -0700

csiph-web