CMM: fix strchr in tmpdisk and software_widget

git-svn-id: svn://kolibrios.org@5624 a494cfbc-eb01-0410-851d-a64ba20cac60
This commit is contained in:
Kirill Lipatov (Leency) 2015-07-29 17:44:24 +00:00
parent e51ebdbd69
commit 155cf5487f
2 changed files with 8 additions and 6 deletions

View File

@ -121,7 +121,7 @@ byte search_for_id_need_to_run(dword key_value, key_name, sec_name, f_name)
if (item_id_need_to_run == current_item_id) if (item_id_need_to_run == current_item_id)
{ {
icon_char_pos = strchr(key_value, ','); icon_char_pos = strchr(key_value, ',');
if (icon_char_pos) ESBYTE[key_value + icon_char_pos - 1] = 0; //delete icon from string if (icon_char_pos) ESBYTE[icon_char_pos] = 0; //delete icon from string
RunProgram(key_value, ""); RunProgram(key_value, "");
} }
current_item_id++; current_item_id++;
@ -149,7 +149,7 @@ byte draw_icons_from_section(dword key_value, key_name, sec_name, f_name)
tmp = cell_w/2; tmp = cell_w/2;
icon_char_pos = strchr(key_value, ','); icon_char_pos = strchr(key_value, ',');
if (icon_char_pos) icon_id = atoi(key_value + icon_char_pos); else icon_id = default_icon; if (icon_char_pos) icon_id = atoi(icon_char_pos+1); else icon_id = default_icon;
img_draw stdcall(skin.image, col*cell_w+tmp-10, row*cell_h+5 + list_pos, 32, 32, 0, icon_id*32); img_draw stdcall(skin.image, col*cell_w+tmp-10, row*cell_h+5 + list_pos, 32, 32, 0, icon_id*32);
WriteTextCenter(col*cell_w+7,row*cell_h+47 + list_pos,cell_w,0xDCDCDC,key_name); WriteTextCenter(col*cell_w+7,row*cell_h+47 + list_pos,cell_w,0xDCDCDC,key_name);
WriteTextCenter(col*cell_w+6,row*cell_h+46 + list_pos,cell_w,0x000000,key_name); WriteTextCenter(col*cell_w+6,row*cell_h+46 + list_pos,cell_w,0x000000,key_name);

View File

@ -41,14 +41,14 @@ char Console_Work()
switch (param[0]) switch (param[0])
{ {
case '?': //ďîěîůü ďî ęîěěŕíäŕě case '?':
case 'h': case 'h':
debugln("tmpdisk command line parameters:"); debugln("tmpdisk command line parameters:");
debugln("a[number]s[size in MB] - add RAM disk"); debugln("a[number]s[size in MB] - add RAM disk");
debugln("d[number] - delete RAM disk"); debugln("d[number] - delete RAM disk");
ExitProcess(); ExitProcess();
break; break;
case 'd': //óäŕëčňü äčńę case 'd':
debugln(DELETE_DISK_TEXT); debugln(DELETE_DISK_TEXT);
del_disk.DiskId = param[1]-'0'; del_disk.DiskId = param[1]-'0';
ioctl.handle = driver_handle; ioctl.handle = driver_handle;
@ -59,7 +59,7 @@ char Console_Work()
ioctl.out_size = 0; ioctl.out_size = 0;
disk_sizes[del_disk.DiskId] = 0; disk_sizes[del_disk.DiskId] = 0;
break; break;
case 'a': //äîáŕâčňü äčńę case 'a':
debugln(ADD_DISK_TEXT); debugln(ADD_DISK_TEXT);
disk_size= strchr(#param, 's'); disk_size= strchr(#param, 's');
if (!disk_size) if (!disk_size)
@ -68,7 +68,9 @@ char Console_Work()
debugln(DONT_KNOW_DISK_SIZE_TEXT); debugln(DONT_KNOW_DISK_SIZE_TEXT);
} }
else else
add_disk.DiskSize = atoi(#param+disk_size)*2048; {
add_disk.DiskSize = atoi(disk_size+1)*2048;
}
strcpy(#size_t, NEW_DISK_TEXT); strcpy(#size_t, NEW_DISK_TEXT);
strcat(#size_t, itoa(add_disk.DiskSize/2048)); strcat(#size_t, itoa(add_disk.DiskSize/2048));
strcat(#size_t, " MB"); strcat(#size_t, " MB");