9front - general discussion about 9front
 help / color / mirror / Atom feed
From: Benjamin Purcell <benjapurcell@gmail.com>
To: 9front@9front.org
Subject: Re: [9front] nupas auth: incompatibility and error messaging
Date: Tue, 21 Mar 2017 21:53:22 -0500	[thread overview]
Message-ID: <CAAsuYKeuYOnXmRg0AS8WjaSNVk83kSgbmEX5j7jwfrhBS-fdZQ@mail.gmail.com> (raw)
In-Reply-To: <197eef1bfc064ad154d32b26d2c10001@youmu.sam-d.org>

At the very least you should check that the char* returned from
smprint is not nil.

But if this were me I would avoid the memory allocation entirely since
we can estimate a reasonable bound on the auth string. In that case I
like to use a static buf instead and print into it sequentially. That
way you also avoid an arguably ugly ternary expression and avoid
another memory allocation that is found below:
http://okturing.com/src/1190/body


  reply	other threads:[~2017-03-22  2:53 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-03-22  0:02 inkswinc
2017-03-22  2:53 ` Benjamin Purcell [this message]
2017-03-22  2:58   ` [9front] " Benjamin Purcell
2017-03-22  3:16 inkswinc
2017-03-22  9:15 cinap_lenrek
2017-03-22  9:17 cinap_lenrek
2017-03-22 17:09 inkswinc
2017-03-22 17:10 inkswinc

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=CAAsuYKeuYOnXmRg0AS8WjaSNVk83kSgbmEX5j7jwfrhBS-fdZQ@mail.gmail.com \
    --to=benjapurcell@gmail.com \
    --cc=9front@9front.org \
    /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;
as well as URLs for NNTP newsgroup(s).