Current-Users archive

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

Re: lint doesn't like lib/libc/string/swab.c



    Date:        Sun, 18 Apr 2010 05:52:57 +0200
    From:        henning petersen <henning.petersen%t-online.de@localhost>
    Message-ID:  <4BCA8219.7080908%t-online.de@localhost>

  | or this patch .

That changes the code - previously, if the length was odd, it was rounded
down to the next lower even value, you're not doing that, just ignoring
lengths that are < 2 (which itself is OK, but does nothing for 3 ...)

I see that earlier code (1.12), rounded up odd lengths, the one you patched
against (1.14), rounds them down - while calling swab() with an odd length
makes no real sense, changing the behaviour for no good reason probably isn't
a good idea.

Just make it back to be a size_t, and put the code in the function back the
way it was (and by all means, file a defect report with POSIX).

kre



Home | Main Index | Thread Index | Old Index