ViewVC Help
View File | Revision Log | Show Annotations | Revision Graph | Root Listing
root/i-scream/projects/libstatgrab/src/saidar/saidar.c
(Generate patch)

Comparing projects/libstatgrab/src/saidar/saidar.c (file contents):
Revision 1.7 by pajs, Sat Oct 18 14:00:21 2003 UTC vs.
Revision 1.8 by pajs, Sat Oct 18 14:08:36 2003 UTC

# Line 210 | Line 210 | void display_data(){
210          char *ptr;
211  
212          move(0,12);
213 <        strncpy(hostname, stats.general_stats->hostname, sizeof(hostname));
213 >        strncpy(hostname, stats.general_stats->hostname, (sizeof(hostname) - 1));
214 >        /* strncpy does not NULL terminate.. If only strlcpy was on all platforms :) */
215 >        hostname[14] = '\0';
216          ptr=strchr(hostname, '.');
217          /* Some hosts give back a FQDN for hostname. To avoid this, we'll
218           * just blank out everything after the first "."

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines