Re: [PATCH 2/5] strbuf: factor out strbuf_expand_step()

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Sat, Jun 17, 2023 at 10:41:44PM +0200, René Scharfe wrote:
> diff --git a/strbuf.c b/strbuf.c
> index 08eec8f1d8..a90b597da1 100644
> --- a/strbuf.c
> +++ b/strbuf.c
> @@ -415,19 +415,24 @@ void strbuf_vaddf(struct strbuf *sb, const char *fmt, va_list ap)
>  	strbuf_setlen(sb, sb->len + len);
>  }
>
> +int strbuf_expand_step(struct strbuf *sb, const char **formatp)
> +{
> +	const char *format = *formatp;
> +	const char *percent = strchrnul(format, '%');

Can format be NULL here? Obviously formatp is never NULL since it is
`&s`, but we guarded the while loop in the pre-image with `while (*s)`
and I am not sure that **formatp is always non-NULL here.

Thanks,
Taylor



[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]

  Powered by Linux