diff options
author | Jim Meyering <jim@meyering.net> | 1993-11-15 14:32:17 +0000 |
---|---|---|
committer | Jim Meyering <jim@meyering.net> | 1993-11-15 14:32:17 +0000 |
commit | 4bce07bc255df2556f53dda05394025c9e712e2b (patch) | |
tree | 16bb2ef1ab210331f597dd43249535b902aefaba /src/who.c | |
parent | 39fd5971dd6fcb6e93db4e33cfa6bedbc4dd8610 (diff) | |
download | coreutils-4bce07bc255df2556f53dda05394025c9e712e2b.tar.xz |
merge with 1.9a
Diffstat (limited to 'src/who.c')
-rw-r--r-- | src/who.c | 14 |
1 files changed, 13 insertions, 1 deletions
@@ -327,7 +327,19 @@ list_entries (n) #endif ) { - printf ("%s ", this->ut_name); + char trimmed_name[sizeof (this->ut_name) + 1]; + int i; + + strncpy (trimmed_name, this->ut_name, sizeof (this->ut_name)); + trimmed_name[sizeof (this->ut_name)] = ' '; + for (i = 0; i <= sizeof (this->ut_name); i++) + { + if (trimmed_name[i] == ' ') + break; + } + trimmed_name[i] = '\0'; + + printf ("%s ", trimmed_name); entries++; } this++; |