From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-vk0-f52.google.com ([209.85.213.52]) by ur; Tue Mar 21 22:53:26 EDT 2017 Received: by mail-vk0-f52.google.com with SMTP id r69so3467706vke.2 for <9front@9front.org>; Tue, 21 Mar 2017 19:53:23 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:in-reply-to:references:from:date:message-id:subject:to; bh=TKeuOxKDxW4csCcZsQ+2zhic7awJvzgeRqaXMf/E0Kk=; b=KCgCr930KVQeRPmfwJm3bak17mp+bKDE54o8STAVPXc3IjvqHPQ8ZkPHT3kB08+0/C bbP2ZRdd59RLxR8CFpQkSPi1w48quZD+XireQnqYrhz6OvFaadcwtN/MmmvK+d9ltz3C NeAbr2zc/3hgha/w4SChiV4qMqlgvtZiAnuB4SUkVfjxKCMx74Tli/UwuQ1L/kf80nLR 5LHnNFps5q0PbcHj/ZMXmju1kDsamgZ4j9WEAmKVnOZsENq9WAJlBtQStWXJ3ihSO48h ol1KjWwutpDse9j3fyySUEhDsqSj2aVeNish/qD9QFydflQXlSDSJUAxPgTs3ussbind Q+Cw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to; bh=TKeuOxKDxW4csCcZsQ+2zhic7awJvzgeRqaXMf/E0Kk=; b=FDszZuG5dbYnYqgJtO0ZE6hUBJ3Bc0kim+7U00jpovtKppLoI7V4UHoqrEj1koZNn3 +vQ4R0knaRj261ab3bpFlM6Hvf5zqe+3MWWhFUJ4tB6smqWBsD2ioaFvJPFLtT/XwFE5 9v1BH4B1KujVlXTjHpqkij9GiyOQ5E8DGFoee31vfUcjCqd0C39oCdopQjxmRSdTF+By OvvBEP6hl6eUXdmn7GDV6VNXXSTmioEYuSBFiGVF3J/7C9cDGwKGjyqyACu0zrLNc98N T2WWZzUY3JpZeSFbFUYZVlc2dlX/3N3yQXiZWvY025EBEkrYOVh4SsM9sXb4mrX9JpJJ +6fA== X-Gm-Message-State: AFeK/H0QHmgob++YyN1t0cm73VYyBiY3/tr13JuZMyxXLqARqYeopgu34CEaqtdV1q7BVrDIbha9iDld6JBtpg== X-Received: by 10.176.91.87 with SMTP id v23mr13256937uae.90.1490151202751; Tue, 21 Mar 2017 19:53:22 -0700 (PDT) MIME-Version: 1.0 Received: by 10.103.45.13 with HTTP; Tue, 21 Mar 2017 19:53:22 -0700 (PDT) In-Reply-To: <197eef1bfc064ad154d32b26d2c10001@youmu.sam-d.org> References: <197eef1bfc064ad154d32b26d2c10001@youmu.sam-d.org> From: Benjamin Purcell Date: Tue, 21 Mar 2017 21:53:22 -0500 Message-ID: Subject: Re: [9front] nupas auth: incompatibility and error messaging To: 9front@9front.org Content-Type: text/plain; charset=UTF-8 List-ID: <9front.9front.org> List-Help: X-Glyph: ➈ X-Bullshit: lossless transactional realtime-java cache layer 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