[Top][All Lists]

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

[bug-patch] lin should be ssize_t, not off_t

From: Tobias Stoeckmann
Subject: [bug-patch] lin should be ssize_t, not off_t
Date: Mon, 24 Nov 2014 19:51:00 +0100


as the subject says, lin should be ssize_t instead of off_t.  This
works on Linux systems I have seen, because sizeof(size_t) is basically
always sizeof(off_t).  I don't know if there are 32 bit Linux systems
with a 64 bit off_t ... But OpenBSD definitely has this one.

The type lin is used in patch as index to arrays, so SIZE_MAX should be
definitely max.  We need a signed version, so it should be ssize_t.

Without such a switch, way too large lins are parsed without errors,
exceeding limits in various parts of the source.

For 32 and 64 bit Linux, there should be no difference, because
sizeof(off_t) = sizeof(ssize_t) as far as I know.  For other systems,
this will definitely fix issues.


reply via email to

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