On 06/20/2012 02:37 PM, Barry deFreese wrote:
Thanks but what are you doing there if you overrun the size of filename (not that they are handling it now either but PATH_MAX is fairly large).
Well, it seems like this function does not return anything, so you can't use an error code. You could just exit(EXIT_FAILURE): after all, size isn't supposed to be larger than PATH_MAX (on systems that define it), so it's probably pretty bad if it is.
You could also write: #ifdef PATH_MAX size = PATH_MAX #else size = strlen(...)+1; #endif filename = malloc(size); ... But duplicating the calls to sprintf() seems pretty bad. Cyril. -- To UNSUBSCRIBE, email to debian-hurd-requ...@lists.debian.org with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org Archive: http://lists.debian.org/4fe1eb83.9070...@gmail.com