> len = snprintf(fname, 99, "%s", buf); > - fname[len-1] = '\0';
> I just deleted that "really, really" NUL-termination line because > it was based on a misunderstanding of snprintf()'s postcondition. Are you sure this code can be simple deleted? It does not only terminate the string but deletes the last character. According to man: " Upon successful return, these functions return the number of characters printed (EXCLUDING the null byte used to end output to strings)." So, if buf was "abc" len would be 3 and fname would become "ab". Best regards, Alexandr -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/