guix-devel
[Top][All Lists]
Advanced

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

Re: 13/30: daemon: Print the line whence we expect an integer.


From: Ludovic Courtès
Subject: Re: 13/30: daemon: Print the line whence we expect an integer.
Date: Sun, 28 Nov 2021 18:13:27 +0100
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/27.2 (gnu/linux)

Hi Tobias!

guix-commits@gnu.org skribis:

> --- a/nix/libstore/local-store.cc
> +++ b/nix/libstore/local-store.cc
> @@ -839,7 +839,8 @@ template<class T> T 
> LocalStore::getIntLineFromSubstituter(Agent & run)
>  {
>      string s = getLineFromSubstituter(run);
>      T res;
> -    if (!string2Int(s, res)) throw Error("integer expected from stream");
> +    if (!string2Int(s, res))
> +        throw Error(format("integer expected from stream: %1%") % s);

I would not print ‘s’ as-is because it could contain garbage, which in
turn could have undesirable side effects.

My 2¢,
Ludo’.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]