Print this page
10107 librpcsvc needs smatch fixes

@@ -17,20 +17,23 @@
  * fields enclosed by brackets "[]" replaced with your own identifying
  * information: Portions Copyright [yyyy] [name of copyright owner]
  *
  * CDDL HEADER END
  */
-#pragma ident   "%Z%%M% %I%     %E% SMI"
 
 /*
  * rusers_simple.c
  * These are the "easy to use" interfaces to rusers.
  *
  * Copyright 2004 Sun Microsystems, Inc.  All rights reserved.
  * Use is subject to license terms.
  */
 
+/*
+ * Copyright (c) 2018, Joyent, Inc.
+ */
+
 #include <string.h>
 #include <rpc/rpc.h>
 #include <rpcsvc/rusers.h>
 #include <stdlib.h>
 

@@ -83,17 +86,17 @@
                                         }
                                         free(uap->utmp_array_val);
                                         xdr_free(xdr_utmpidlearr, (char *)&up);
                                         return (-1);
                                 }
-                                strncpy(rutp->ut_line,
+                                (void) strncpy(rutp->ut_line,
                                         up.uia_arr[i]->ui_utmp.ut_line,
                                         sizeof (forsize.ut_line)+1);
-                                strncpy(rutp->ut_user,
+                                (void) strncpy(rutp->ut_user,
                                         up.uia_arr[i]->ui_utmp.ut_name,
                                         sizeof (forsize.ut_name)+1);
-                                strncpy(rutp->ut_host,
+                                (void) strncpy(rutp->ut_host,
                                         up.uia_arr[i]->ui_utmp.ut_host,
                                         sizeof (forsize.ut_host)+1);
                                 rutp->ut_idle = up.uia_arr[i]->ui_idle;
                                 rutp->ut_time = up.uia_arr[i]->ui_utmp.ut_time;
                                 rutp->ut_type = RUSERS_USER_PROCESS;