[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH] ntoab: Handle LONG_MIN case.
From: |
Danny Milosavljevic |
Subject: |
Re: [PATCH] ntoab: Handle LONG_MIN case. |
Date: |
Wed, 3 Jun 2020 20:58:34 +0200 |
Hi Janneke,
On Wed, 03 Jun 2020 08:02:28 +0200
Jan Nieuwenhuizen <janneke@gnu.org> wrote:
> Danny Milosavljevic writes:
>
> > * lib/mes/ntoab.c (ntoab): Handle LONG_MIN case.
> > ---
> > lib/mes/ntoab.c | 6 ++++++
> > 1 file changed, 6 insertions(+)
> >
> > diff --git a/lib/mes/ntoab.c b/lib/mes/ntoab.c
> > index ce91c73a..382e2326 100644
> > --- a/lib/mes/ntoab.c
> > +++ b/lib/mes/ntoab.c
> > @@ -20,10 +20,16 @@
> >
> > #include <assert.h>
> > #include <mes/lib.h>
> > +#include <stdint.h>
> > +
> > +#define STR(x) #x
> > +#define XSTR(s) STR(s)
> >
> > char *
> > ntoab (long x, int base, int signed_p)
> > {
> > + if (x == LONG_MIN && base == 10)
> > + return XSTR(LONG_MIN);
>
> Wondering what happens if base == 8, or base == 16 and x == LONG_MIN?
It's a problem ;)
Are only base in {10, 8, 16} supposed to be allowed--or any random base, too?
pgpQ0WXTHv0nu.pgp
Description: OpenPGP digital signature