|
1 | 1 | /*
|
2 |
| - * ReactOS Win32 Applications |
3 |
| - * Copyright (C) 2005 ReactOS Team |
4 |
| - * |
5 |
| - * This program is free software; you can redistribute it and/or modify |
6 |
| - * it under the terms of the GNU General Public License as published by |
7 |
| - * the Free Software Foundation; either version 2 of the License, or |
8 |
| - * (at your option) any later version. |
9 |
| - * |
10 |
| - * This program is distributed in the hope that it will be useful, |
11 |
| - * but WITHOUT ANY WARRANTY; without even the implied warranty of |
12 |
| - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
13 |
| - * GNU General Public License for more details. |
14 |
| - * |
15 |
| - * You should have received a copy of the GNU General Public License |
16 |
| - * along with this program; if not, write to the Free Software |
17 |
| - * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. |
18 |
| - */ |
19 |
| - |
20 |
| -/* |
21 |
| - * COPYRIGHT: See COPYING in the top level directory |
22 | 2 | * PROJECT: ReactOS netstat utility
|
| 3 | + * LICENSE: GPL - See COPYING in the top level directory |
23 | 4 | * FILE: apps/utils/net/netstat/netstat.c
|
24 | 5 | * PURPOSE: display IP stack statistics
|
25 |
| - * PROGRAMMERS: Ged Murphy ([email protected]) |
26 |
| - * REVISIONS: |
27 |
| - * Ged Murphy 19/09/05 Created |
28 |
| - * Some ideas/code taken from Rob Dickinson's original app |
29 |
| - * |
| 6 | + * COPYRIGHT: Copyright 2005 Ged Murphy <[email protected]> |
30 | 7 | */
|
31 |
| - |
32 | 8 | /*
|
33 | 9 | * TODO:
|
34 | 10 | * sort function return values.
|
@@ -588,14 +564,15 @@ GetIpHostName(BOOL Local, UINT IpAddr, CHAR Name[], int NameLen)
|
588 | 564 | (nIpAddr >> 8) & 0xFF,
|
589 | 565 | (nIpAddr) & 0xFF);
|
590 | 566 | } else {
|
591 |
| - gethostname(Name, NameLen); |
| 567 | + if (gethostname(Name, NameLen) != 0) |
| 568 | + DoFormatMessage(WSAGetLastError()); |
592 | 569 | }
|
593 | 570 | } else if (IpAddr == 0x0100007f) {
|
594 | 571 | if (Local) {
|
595 | 572 | if (gethostname(Name, NameLen) != 0)
|
596 | 573 | DoFormatMessage(WSAGetLastError());
|
597 | 574 | } else {
|
598 |
| - strcpy(Name, "localhost"); |
| 575 | + _tcsncpy(Name, _T("localhost"), 10); |
599 | 576 | }
|
600 | 577 | // } else if (phostent = gethostbyaddr((char*)&ipaddr, sizeof(nipaddr), PF_INET)) {
|
601 | 578 | // strcpy(name, phostent->h_name);
|
|
0 commit comments