Showing 2 changed files with 2 additions and 4 deletions
+1 -1
ntpprint-win.c
... ...
@@ -101,7 +101,7 @@ int main(int argc, char *argv[]) {
101 101
     packet.txTm_s = ntohl(packet.txTm_s);  // Convert from network byte order
102 102
     time_t txTime = (time_t)(packet.txTm_s - NTP_TIMESTAMP_DELTA);
103 103
 
104
-    printf("Received time: %s", ctime(&txTime));
104
+    printf("NTP Response: %s", ctime(&txTime));
105 105
 
106 106
     closesocket(sock);
107 107
     WSACleanup();
+1 -3
ntpprint.c
... ...
@@ -43,7 +43,7 @@ int main(int argc, char *argv[]) {
43 43
 
44 44
     server = gethostbyname(host);
45 45
     if (!server) {
46
-        fprintf(stderr, "Error: No such host %s\n", host);
46
+        fprintf(stderr, "Error: Cannot resolve hostname %s\n", ntp_server);
47 47
         close(sockfd);
48 48
         return 1;
49 49
     }
... ...
@@ -84,8 +84,6 @@ int main(int argc, char *argv[]) {
84 84
     transmit_time = ntohl(transmit_time);
85 85
 
86 86
     time_t time_recv = transmit_time - NTP_TIMESTAMP_DELTA;
87
-
88
-    // Set system time
89 87
     struct timeval tv = {
90 88
         .tv_sec = time_recv,
91 89
         .tv_usec = 0