radius: Fix compiler warning
authorKurt Van Dijck <dev.kurt@vandijck-laurijssen.be>
Thu, 26 Sep 2019 07:20:59 +0000 (09:20 +0200)
committerPaul Mackerras <paulus@ozlabs.org>
Tue, 1 Oct 2019 22:46:29 +0000 (08:46 +1000)
Signed-off-by: Kurt Van Dijck <dev.kurt@vandijck-laurijssen.be>
Signed-off-by: Paul Mackerras <paulus@ozlabs.org>
pppd/plugins/radius/clientid.c

index d49579c43cc3ec10039bf754268495dcad16c4fa..09ec3d04c56346e309d0c209690214dcbe9dd3d8 100644 (file)
@@ -110,7 +110,7 @@ UINT4 rc_map2id(char *name)
        if (*name != '/')
                strcpy(ttyname, "/dev/");
 
-       strncat(ttyname, name, sizeof(ttyname));
+       strncat(ttyname, name, sizeof(ttyname) - strlen(ttyname) -1);
 
        for(p = map2id_list; p; p = p->next)
                if (!strcmp(ttyname, p->name)) return p->id;