summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/adv.c2
-rw-r--r--src/chgtype.c3
-rw-r--r--src/dirn.c2
-rw-r--r--src/dirpart.c8
-rw-r--r--src/fat1x.c2
-rw-r--r--src/partgpt.c2
-rw-r--r--src/parthumax.c2
-rw-r--r--src/parti386.c2
-rw-r--r--src/partmac.c2
-rw-r--r--src/partsun.c2
-rw-r--r--src/partxbox.c2
11 files changed, 23 insertions, 6 deletions
diff --git a/src/adv.c b/src/adv.c
index 0a6e693..a681432 100644
--- a/src/adv.c
+++ b/src/adv.c
@@ -215,6 +215,7 @@ static int adv_string_to_command(char**current_cmd, list_part_t **current_elemen
{
int keep_asking;
int command='q';
+ assert(current_cmd!=NULL);
do
{
keep_asking=0;
@@ -474,6 +475,7 @@ void interface_adv(disk_t *disk_car, const int verbose,const int dump_ind, const
unsigned int menu=0;
list_part_t *list_part;
list_part_t *current_element;
+ assert(current_cmd!=NULL);
log_info("\nInterface Advanced\n");
list_part=disk_car->arch->read_part(disk_car,verbose,0);
current_element=list_part;
diff --git a/src/chgtype.c b/src/chgtype.c
index 8446c9f..5db0301 100644
--- a/src/chgtype.c
+++ b/src/chgtype.c
@@ -27,6 +27,7 @@
#ifdef HAVE_STDLIB_H
#include <stdlib.h>
#endif
+#include <assert.h>
#include "types.h"
#include "common.h"
#include "chgtype.h"
@@ -38,6 +39,8 @@ extern const arch_fnct_t arch_none;
void change_part_type_cli(const disk_t *disk_car,partition_t *partition, char **current_cmd)
{
+ assert(current_cmd!=NULL);
+ assert(partition!=NULL);
if(*current_cmd==NULL || partition->arch==NULL)
return ;
if(partition->arch==NULL)
diff --git a/src/dirn.c b/src/dirn.c
index 588b65e..dbf4fa3 100644
--- a/src/dirn.c
+++ b/src/dirn.c
@@ -596,7 +596,7 @@ static int dir_partition_aux(disk_t *disk, const partition_t *partition, dir_dat
inode_known[depth]=inode;
dir_data->get_dir(disk, partition, dir_data, inode, &dir_list);
dir_aff_log(dir_data, &dir_list);
- if(*current_cmd!=NULL)
+ if(current_cmd!=NULL && *current_cmd!=NULL)
{
/* TODO: handle copy_files */
dir_data->current_directory[current_directory_namelength]='\0';
diff --git a/src/dirpart.c b/src/dirpart.c
index d3d5699..7380dd5 100644
--- a/src/dirpart.c
+++ b/src/dirpart.c
@@ -122,7 +122,7 @@ dir_partition_t dir_partition(disk_t *disk, const partition_t *partition, const
log_partition(disk,partition);
screen_buffer_add("Support for this filesystem hasn't been implemented.\n");
screen_buffer_to_log();
- if(*current_cmd==NULL)
+ if(current_cmd==NULL || *current_cmd==NULL)
{
#ifdef HAVE_NCURSES
screen_buffer_display(window,"",NULL);
@@ -139,7 +139,7 @@ dir_partition_t dir_partition(disk_t *disk, const partition_t *partition, const
log_partition(disk,partition);
screen_buffer_add("Support for this filesystem wasn't enabled during compilation.\n");
screen_buffer_to_log();
- if(*current_cmd==NULL)
+ if(current_cmd==NULL || *current_cmd==NULL)
{
#ifdef HAVE_NCURSES
screen_buffer_display(window,"",NULL);
@@ -156,7 +156,7 @@ dir_partition_t dir_partition(disk_t *disk, const partition_t *partition, const
log_partition(disk,partition);
screen_buffer_add("Can't open filesystem. Filesystem seems damaged.\n");
screen_buffer_to_log();
- if(*current_cmd==NULL)
+ if(current_cmd==NULL || *current_cmd==NULL)
{
#ifdef HAVE_NCURSES
screen_buffer_display(window,"",NULL);
@@ -167,7 +167,7 @@ dir_partition_t dir_partition(disk_t *disk, const partition_t *partition, const
{
int recursive=0;
int copy_files=0;
- if(*current_cmd!=NULL)
+ if(current_cmd!=NULL && *current_cmd!=NULL)
{
int do_continue;
do
diff --git a/src/fat1x.c b/src/fat1x.c
index ce7d553..4af020a 100644
--- a/src/fat1x.c
+++ b/src/fat1x.c
@@ -66,7 +66,7 @@ static void dump_fat1x(disk_t *disk_car, partition_t *partition, const unsigned
{
log_info("Boot sector\n");
dump_log(buffer_bs, FAT1x_BOOT_SECTOR_SIZE);
- if(*current_cmd==NULL)
+ if(current_cmd==NULL || *current_cmd==NULL)
{
#ifdef HAVE_NCURSES
dump_fat1x_ncurses(disk_car, partition, buffer_bs);
diff --git a/src/partgpt.c b/src/partgpt.c
index c920e5e..f4e7d10 100644
--- a/src/partgpt.c
+++ b/src/partgpt.c
@@ -42,6 +42,7 @@
#if defined(HAVE_SYS_UUID_H)
#include <sys/uuid.h>
#endif
+#include <assert.h>
#include "common.h"
#include "fnctdsk.h"
#include "lang.h"
@@ -335,6 +336,7 @@ static list_part_t *init_part_order_gpt(const disk_t *disk_car, list_part_t *lis
list_part_t *add_partition_gpt_cli(disk_t *disk_car,list_part_t *list_part, char **current_cmd)
{
+ assert(current_cmd!=NULL);
partition_t *new_partition=partition_new(&arch_gpt);
new_partition->part_offset=disk_car->sector_size;
new_partition->part_size=disk_car->disk_size-new_partition->part_offset;
diff --git a/src/parthumax.c b/src/parthumax.c
index adc757f..c9af332 100644
--- a/src/parthumax.c
+++ b/src/parthumax.c
@@ -33,6 +33,7 @@
#include <string.h>
#endif
#include <ctype.h> /* tolower */
+#include <assert.h>
#include "types.h"
#include "common.h"
#include "fnctdsk.h"
@@ -186,6 +187,7 @@ list_part_t *add_partition_humax_cli(disk_t *disk_car,list_part_t *list_part, ch
{
CHS_t start,end;
partition_t *new_partition=partition_new(&arch_humax);
+ assert(current_cmd!=NULL);
start.cylinder=0;
start.head=0;
start.sector=1;
diff --git a/src/parti386.c b/src/parti386.c
index 962115e..a0662d9 100644
--- a/src/parti386.c
+++ b/src/parti386.c
@@ -33,6 +33,7 @@
#include <string.h>
#endif
#include <ctype.h> /* tolower */
+#include <assert.h>
#include "types.h"
#include "common.h"
#include "fnctdsk.h"
@@ -1222,6 +1223,7 @@ list_part_t *add_partition_i386_cli(disk_t *disk_car, list_part_t *list_part, ch
{
CHS_t start,end;
partition_t *new_partition=partition_new(&arch_i386);
+ assert(current_cmd!=NULL);
start.cylinder=0;
start.head=0;
start.sector=1;
diff --git a/src/partmac.c b/src/partmac.c
index 4f08753..f3f86e7 100644
--- a/src/partmac.c
+++ b/src/partmac.c
@@ -33,6 +33,7 @@
#include <string.h>
#endif
#include <ctype.h> /* tolower */
+#include <assert.h>
#include "types.h"
#include "common.h"
#include "fnctdsk.h"
@@ -212,6 +213,7 @@ static list_part_t *init_part_order_mac(const disk_t *disk_car, list_part_t *lis
list_part_t *add_partition_mac_cli(disk_t *disk_car,list_part_t *list_part, char **current_cmd)
{
partition_t *new_partition=partition_new(&arch_mac);
+ assert(current_cmd!=NULL);
new_partition->part_offset=disk_car->sector_size;
new_partition->part_size=disk_car->disk_size-disk_car->sector_size;
while(*current_cmd[0]==',')
diff --git a/src/partsun.c b/src/partsun.c
index 122a64a..1bf80c9 100644
--- a/src/partsun.c
+++ b/src/partsun.c
@@ -33,6 +33,7 @@
#include <string.h>
#endif
#include <ctype.h> /* tolower */
+#include <assert.h>
#include "types.h"
#include "common.h"
#include "fnctdsk.h"
@@ -218,6 +219,7 @@ static list_part_t *init_part_order_sun(const disk_t *disk_car, list_part_t *lis
list_part_t *add_partition_sun_cli(disk_t *disk_car,list_part_t *list_part, char **current_cmd)
{
CHS_t start,end;
+ assert(current_cmd!=NULL);
partition_t *new_partition=partition_new(&arch_sun);
start.cylinder=0;
start.head=0;
diff --git a/src/partxbox.c b/src/partxbox.c
index c426b99..699264d 100644
--- a/src/partxbox.c
+++ b/src/partxbox.c
@@ -33,6 +33,7 @@
#include <string.h>
#endif
#include <ctype.h> /* tolower */
+#include <assert.h>
#include "types.h"
#include "common.h"
#include "fnctdsk.h"
@@ -147,6 +148,7 @@ static list_part_t *init_part_order_xbox(const disk_t *disk_car, list_part_t *li
list_part_t *add_partition_xbox_cli(disk_t *disk_car,list_part_t *list_part, char **current_cmd)
{
partition_t *new_partition=partition_new(&arch_xbox);
+ assert(current_cmd!=NULL);
new_partition->part_offset=disk_car->sector_size;
new_partition->part_size=disk_car->disk_size-disk_car->sector_size;
while(*current_cmd[0]==',')