[Openvpn-devel] [PATCH 12/13] Memory size arithmetic reviewed according to 64-bit MSVC complaints

2017-10-10 Thread simon
From: Simon Rozman --- src/openvpnserv/automatic.c | 14 -- src/openvpnserv/interactive.c | 12 ++-- 2 files changed, 14 insertions(+), 12 deletions(-) diff --git a/src/openvpnserv/automatic.c b/src/openvpnserv/automatic.c index 6c39aaa..3e8f6ed 100644 --- a/src/openvpnser

Re: [Openvpn-devel] [PATCH 12/13] Memory size arithmetic reviewed according to 64-bit MSVC complaints

2017-11-11 Thread Selva
Hi, Some of these changes are of dubious value as the string lengths involved are guaranteed to be small and there is no scope for overflow. And casting only stops the compiler warning, not potential overflow, if any.. As for the offending mixed int/size_t arithmetic, a better option is to just t

Re: [Openvpn-devel] [PATCH 12/13] Memory size arithmetic reviewed according to 64-bit MSVC complaints

2017-11-13 Thread Simon Rozman
Hi, > Some of these changes are of dubious value as the string lengths involved > are guaranteed to be small and there is no scope for overflow. And casting > only stops the compiler warning, not potential overflow, if any.. Exactly. Where there's no scope for an overflow and compiler is too dumb

Re: [Openvpn-devel] [PATCH 12/13] Memory size arithmetic reviewed according to 64-bit MSVC complaints

2017-11-13 Thread Selva
Hi, > > const char *p = _tcsrchr(find->cFileName, TEXT('.')); > > return p && p != find->cFileName && !_tcsicmp(p+1, ext); > > > > No _tcslen() and no offending size variables. > > And that convoluted original is then gone. > > The resulting code would look a lot nicer indeed. Stay tuned