Rearranged comments and some variables initialization.

This commit is contained in:
TheDarkBug 2021-03-18 22:53:32 +01:00
parent 57e016e3dc
commit a73c3bf70c

View file

@ -37,9 +37,9 @@
struct utsname sys_var;
struct sysinfo sys;
int ram_max = 0, ram_free = 0, pkgs, a_i_flag = 0;
// initialise the variables to store data, gpu array can hold up to 8 gpus
int ram_max = 0, ram_free = 0, pkgs, a_i_flag = 0;
char user[32], host[256], shell[64], version_name[64], cpu_model[256], gpu_model[8][256] = {{'0'},{'0'},{'0'},{'0'},{'0'},{'0'},{'0'},{'0'}}, pkgman_name[64], image_name[32];
int pkgman();
@ -143,8 +143,7 @@ void print_info() {
// print the gpus
int gpu_iter = 0;
while(gpu_model[gpu_iter][0] != '0')
{
while(gpu_model[gpu_iter][0] != '0') {
printf( "\033[18C%s%sGPUWU %s%s\n",
NORMAL, BOLD, NORMAL, gpu_model[gpu_iter]);
gpu_iter++;
@ -224,10 +223,8 @@ void get_info() { // get all necessary info
fclose(gpu);
// format the strings a bit
for(int i = 0; i < gpun; i++)
{
for (int j = 42; j < 256; j++) //max gpu_name length
{
for(int i = 0; i < gpun; i++) {
for (int j = 42; j < 256; j++) { //max gpu_name length
gpu_model[i][j] = '\0';
}
}