Re: [dinput] initial support for BSD's usbhid joysticks

2008-04-27 Thread Vitaliy Margolen
Christoph Frick wrote: > Add dinput support for BSD's usbhid joysticks > > + if (have_joy_devs == 0) { > + joy_devs = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, > sizeof(struct JoyDev)); > + } else { > + HeapReAlloc(GetProcessHeap(), 0, joy_devs, (1 + have_joy_devs) *

Re: [dinput] initial support for BSD's usbhid joysticks

2008-04-26 Thread Christoph Frick
On Sat, Apr 26, 2008 at 08:57:28AM -0600, Vitaliy Margolen wrote: > Please use 4 spaces indentation, no tabs. what happened to original author decides? ;) i will run the uncopied parts through indent once i find the -unreadable flag for it... > > + snprintf(buf, MAX_PATH, FMT_UHIDDEVS,

Re: [dinput] initial support for BSD's usbhid joysticks

2008-04-26 Thread Juan Lang
> No (in case buffer at least 1 byte long). Oh, right you are! Thanks, I did confuse that the strncpy. --Juan

Re: [dinput] initial support for BSD's usbhid joysticks

2008-04-26 Thread Vitaliy Margolen
Juan Lang wrote: >> snprintf always writes terminating '\0' character at the end of the string. > > Only if the buffer contains enough space for the terminating null. > No (in case buffer at least 1 byte long). From man page: The functions snprintf() and vsnprintf() write at most size bytes (in

Re: [dinput] initial support for BSD's usbhid joysticks

2008-04-26 Thread Juan Lang
> snprintf always writes terminating '\0' character at the end of the string. Only if the buffer contains enough space for the terminating null. > You don't need to explicitly do that yourself. That's probably true in this case. --Juan

Re: [dinput] initial support for BSD's usbhid joysticks

2008-04-26 Thread Vitaliy Margolen
Christoph Frick wrote: > From 7618ceb6941c0dffac9c48c1fa1aeb7e821673a2 Mon Sep 17 00:00:00 2001 > From: Christoph Frick <[EMAIL PROTECTED]> > Date: Sat, 26 Apr 2008 02:50:01 +0200 > Subject: [PATCH] Initial support for BSD's usbhid joysticks > > Please consider this a tracer bullet. I had only tim