From 155cf5487f473a833f793f14bab791f3b23ba4fd Mon Sep 17 00:00:00 2001 From: "Kirill Lipatov (Leency)" Date: Wed, 29 Jul 2015 17:44:24 +0000 Subject: [PATCH] CMM: fix strchr in tmpdisk and software_widget git-svn-id: svn://kolibrios.org@5624 a494cfbc-eb01-0410-851d-a64ba20cac60 --- programs/cmm/software_widget/software_widget.c | 4 ++-- programs/cmm/tmpdisk/t_console.c | 10 ++++++---- 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/programs/cmm/software_widget/software_widget.c b/programs/cmm/software_widget/software_widget.c index a63309d246..fad150f879 100644 --- a/programs/cmm/software_widget/software_widget.c +++ b/programs/cmm/software_widget/software_widget.c @@ -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) { 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, ""); } 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; 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); 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); diff --git a/programs/cmm/tmpdisk/t_console.c b/programs/cmm/tmpdisk/t_console.c index 05a8f03bde..34c6aead79 100644 --- a/programs/cmm/tmpdisk/t_console.c +++ b/programs/cmm/tmpdisk/t_console.c @@ -41,14 +41,14 @@ char Console_Work() switch (param[0]) { - case '?': //помощь по коммандам + case '?': case 'h': debugln("tmpdisk command line parameters:"); debugln("a[number]s[size in MB] - add RAM disk"); debugln("d[number] - delete RAM disk"); ExitProcess(); break; - case 'd': //удалить диск + case 'd': debugln(DELETE_DISK_TEXT); del_disk.DiskId = param[1]-'0'; ioctl.handle = driver_handle; @@ -59,7 +59,7 @@ char Console_Work() ioctl.out_size = 0; disk_sizes[del_disk.DiskId] = 0; break; - case 'a': //добавить диск + case 'a': debugln(ADD_DISK_TEXT); disk_size= strchr(#param, 's'); if (!disk_size) @@ -68,7 +68,9 @@ char Console_Work() debugln(DONT_KNOW_DISK_SIZE_TEXT); } else - add_disk.DiskSize = atoi(#param+disk_size)*2048; + { + add_disk.DiskSize = atoi(disk_size+1)*2048; + } strcpy(#size_t, NEW_DISK_TEXT); strcat(#size_t, itoa(add_disk.DiskSize/2048)); strcat(#size_t, " MB");