Skip to content

Commit d12f4f6

Browse files
authored
Merge pull request #18 from git-user-cpp/development
v4.0.1 - Optimize RAM usage
2 parents 07d8247 + 29e93bc commit d12f4f6

File tree

5 files changed

+7
-5
lines changed

5 files changed

+7
-5
lines changed

src/cpu/cpu_info.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,11 +24,11 @@ void print_cpu_info(void)
2424
if (cpu_file)
2525
{
2626
char line[128];
27-
int lines = 0;
27+
uint8_t lines = 0;
2828
while (fgets(line, sizeof(line), cpu_file) && lines < 19)
2929
{
3030
printf("| %s", line);
31-
lines++;
31+
++lines;
3232
}
3333
fclose(cpu_file);
3434
printf("|____________\n\n");

src/cpu/cpu_info.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
#ifndef CPU_INFO_H_SENTRY
1212
#define CPU_INFO_H_SENTRY
1313
#include <stdio.h>
14+
#include <stdint.h>
1415

1516
void print_cpu_info(void);
1617
void print_full_cpu_info(void);

src/hlp/hlp_info.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,5 +93,5 @@ void print_hlp_info(void)
9393
void print_ver_info(void)
9494
{
9595
print_banner();
96-
printf("spynix v4.0.0\n\nFor more info visit: https://github.com/git-user-cpp/spynix\n");
96+
printf("spynix v4.0.1\n\nFor more info visit: https://github.com/git-user-cpp/spynix\n");
9797
}

src/net/net_info.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ void print_net_info(char *hostname)
1414
{
1515
struct hostent *host = gethostbyname(hostname);
1616
struct ifaddrs *ifaddr, *ifa;
17-
int i;
17+
uint8_t i;
1818

1919
if(host == NULL)
2020
{
@@ -25,7 +25,7 @@ void print_net_info(char *hostname)
2525
{
2626
printf("Host Name: %s\n", host->h_name);
2727
printf("IP Address: ");
28-
for(i = 0; host->h_addr_list[i] != NULL; i++)
28+
for(i = 0; host->h_addr_list[i] != NULL; ++i)
2929
{
3030
printf("%s ", inet_ntoa(*(struct in_addr *)host->h_addr_list[i]));
3131
}

src/net/net_info.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
#include <sys/socket.h>
1717
#include <netdb.h>
1818
#include <arpa/inet.h>
19+
#include <stdint.h>
1920

2021
void print_net_info(char *hostname);
2122
#endif

0 commit comments

Comments
 (0)