Signed-off-by: Krzysztof Opasiak <k.opas...@samsung.com>
---
 src/usbg.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/usbg.c b/src/usbg.c
index bbba689..d2ec246 100644
--- a/src/usbg.c
+++ b/src/usbg.c
@@ -2058,7 +2058,7 @@ int usbg_create_config(usbg_gadget *g, int id, const char 
*label,
        free_space = sizeof(cpath) - n;
        /* Append string at the end of previous one */
        n = snprintf(&(cpath[n]), free_space, "/%s", (*c)->name);
-       if (n < free_space) {
+       if (n >= free_space) {
                ret = USBG_ERROR_PATH_TOO_LONG;
                usbg_free_config(conf);
                goto out;
-- 
1.7.9.5

--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to