signal(SIGINT, edit_abort);
d_char = malloc(3); /* provide a buffer for multi-byte chars */
d_word = malloc(150);
- *d_word = (char) NULL;
+ *d_word = '\0';
d_line = NULL;
dlt_line = txtalloc();
dlt_line->line = d_line;
d_char[0] = *point;
d_char[1] = *(point + 1);
}
- d_char[del_width] = (unsigned char) NULL;
+ d_char[del_width] = '\0';
}
while (temp_pos <= curr_line->line_length)
{
if (in == 8)
{
d_char[0] = '\n';
- d_char[1] = (unsigned char) NULL;
+ d_char[1] = '\0';
}
tp = point;
temp_pos = 1;
tp++;
temp2++;
}
- *tp = (char) NULL;
+ *tp = '\0';
free(temp_buff->line);
free(temp_buff);
temp_buff = curr_line;
waddch(window, character);
return(1);
}
- for (i2 = 0; (string[i2] != (char) NULL) && (((column+i2+1)-horiz_offset) < last_col); i2++)
+ for (i2 = 0; (string[i2] != '\0') && (((column+i2+1)-horiz_offset) < last_col); i2++)
waddch(window, string[i2]);
return(strlen((char*)string));
}
temp++;
}
temp=point;
- *temp = (char) NULL;
+ *temp = '\0';
temp = resiz_line((1 - temp_nod->line_length), curr_line, position);
curr_line->line_length = 1 + temp - curr_line->line;
}
curr_line->line_length = position;
curr_line = temp_nod;
- *extra = (char) NULL;
+ *extra = '\0';
position = 1;
point= curr_line->line;
if (disp)
unsigned char *next_word(string) /* move to next word in string */
unsigned char *string;
{
- while ((*string != (char) NULL) && ((*string != 32) && (*string != 9)))
+ while ((*string != '\0') && ((*string != 32) && (*string != 9)))
string++;
- while ((*string != (char) NULL) && ((*string == 32) || (*string == 9)))
+ while ((*string != '\0') && ((*string == 32) || (*string == 9)))
string++;
return(string);
}
if (in == 1) /* control a */
{
string = get_string(ascii_code_str, TRUE);
- if (*string != (char) NULL)
+ if (*string != '\0')
{
in = atoi((char*)string);
wmove(text_win, scr_vert, (scr_horz - horiz_offset));
else if (in == 15) /* control o */
{
string = get_string(ascii_code_str, TRUE);
- if (*string != (char) NULL)
+ if (*string != '\0')
{
in = atoi((char*)string);
wmove(text_win, scr_vert, (scr_horz - horiz_offset));
}
wrefresh(com_win);
if (esc_flag)
- in = (char) NULL;
+ in = '\0';
} while ((in != '\n') && (in != '\r'));
- *nam_str = (char) NULL;
+ *nam_str = '\0';
nam_str = tmp_string;
if (((*nam_str == ' ') || (*nam_str == 9)) && (advance))
nam_str = next_word(nam_str);
strng1 = string1;
strng2 = string2;
tmp = 0;
- if ((strng1 == NULL) || (strng2 == NULL) || (*strng1 == (char) NULL) || (*strng2 == (char) NULL))
+ if ((strng1 == NULL) || (strng2 == NULL) || (*strng1 == '\0') || (*strng2 == '\0'))
return(FALSE);
equal = TRUE;
while (equal)
}
strng1++;
strng2++;
- if ((*strng1 == (char) NULL) || (*strng2 == (char) NULL) || (*strng1 == ' ') || (*strng2 == ' '))
+ if ((*strng1 == '\0') || (*strng2 == '\0') || (*strng1 == ' ') || (*strng2 == ' '))
break;
tmp++;
}
wmove(com_win, 0, 0);
wclrtoeol(com_win);
text_changes = TRUE;
- if ((tmp_file != NULL) && (*tmp_file != (char) NULL))
+ if ((tmp_file != NULL) && (*tmp_file != '\0'))
wprintw(com_win, file_read_fin_msg, tmp_file);
}
wrefresh(com_win);
point++;
str1++;
}
- *point = (char) NULL;
+ *point = '\0';
*append = FALSE;
if ((num == length) && (*str2 != '\n'))
*append = TRUE;
| portion of file_op()
*/
- if ((file_name == NULL) || (*file_name == (char) NULL))
+ if ((file_name == NULL) || (*file_name == '\0'))
file_name = get_string(save_file_name_prompt, TRUE);
- if ((file_name == NULL) || (*file_name == (char) NULL))
+ if ((file_name == NULL) || (*file_name == '\0'))
{
wmove(com_win, 0, 0);
wprintw(com_win, file_not_saved_msg);
free(curr_line->next_line);
}
curr_line->next_line = NULL;
- *curr_line->line = (char) NULL;
+ *curr_line->line = '\0';
curr_line->line_length = 1;
curr_line->line_number = 1;
point = curr_line->line;
int iter;
int found;
- if ((srch_str == NULL) || (*srch_str == (char) NULL))
+ if ((srch_str == NULL) || (*srch_str == '\0'))
return(FALSE);
if (display_message)
{
if (case_sen) /* if case sensitive */
{
srch_3 = srch_str;
- while ((*srch_2 == *srch_3) && (*srch_3 != (char) NULL))
+ while ((*srch_2 == *srch_3) && (*srch_3 != '\0'))
{
found = TRUE;
srch_2++;
else /* if not case sensitive */
{
srch_3 = u_srch_str;
- while ((toupper(*srch_2) == *srch_3) && (*srch_3 != (char) NULL))
+ while ((toupper(*srch_2) == *srch_3) && (*srch_3 != '\0'))
{
found = TRUE;
srch_2++;
srch_3++;
}
} /* end else */
- if (!((*srch_3 == (char) NULL) && (found)))
+ if (!((*srch_3 == '\0') && (found)))
{
found = FALSE;
if (iter < srch_line->line_length)
{
if (srch_str != NULL)
free(srch_str);
- if ((u_srch_str != NULL) && (*u_srch_str != (char) NULL))
+ if ((u_srch_str != NULL) && (*u_srch_str != '\0'))
free(u_srch_str);
srch_str = get_string(search_prompt_str, FALSE);
gold = FALSE;
srch_3 = srch_str;
srch_1 = u_srch_str = malloc(strlen((char*)srch_str) + 1);
- while (*srch_3 != (char) NULL)
+ while (*srch_3 != '\0')
{
*srch_1 = toupper(*srch_3);
srch_1++;
srch_3++;
}
- *srch_1 = (char) NULL;
+ *srch_1 = '\0';
search(TRUE);
}
{
in = d_char[0];
insert(in);
- if (d_char[1] != (unsigned char) NULL)
+ if (d_char[1] != '\0')
{
in = d_char[1];
insert(in);
d_word2++;
d_word3++;
}
- *d_word2 = (char) NULL;
+ *d_word2 = '\0';
d_wrd_len = difference = d_word2 - d_word;
d_word2 = point;
while (tposit < curr_line->line_length)
d_word3++;
}
curr_line->line_length -= difference;
- *d_word2 = (char) NULL;
+ *d_word2 = '\0';
draw_line(scr_vert, scr_horz,point,position,curr_line->line_length);
d_char[0] = tmp_char[0];
d_char[1] = tmp_char[1];
}
curr_line->line_length += d_wrd_len;
tmp_old_ptr = point;
- *tmp_ptr = (char) NULL;
+ *tmp_ptr = '\0';
tmp_ptr = tmp_space;
tposit = 1;
/*
tmp_ptr++;
tmp_old_ptr++;
}
- *tmp_old_ptr = (char) NULL;
+ *tmp_old_ptr = '\0';
free(tmp_space);
draw_line(scr_vert, scr_horz, point, position, curr_line->line_length);
}
tposit++;
}
dlt_line->line_length = 1 + tposit - position;
- *dl1 = (char) NULL;
- *point = (char) NULL;
+ *dl1 = *point = '\0';
curr_line->line_length = position;
wclrtoeol(text_win);
if (curr_line->next_line != NULL)
ud1++;
ud2++;
}
- *ud1 = (char) NULL;
+ *ud1 = '\0';
draw_line(scr_vert, scr_horz,point,position,curr_line->line_length);
}
flag = FALSE;
string = in_file_name;
- if ((string == NULL) || (*string == (char) NULL))
+ if ((string == NULL) || (*string == '\0'))
string = get_string(save_file_name_prompt, TRUE);
- if ((string == NULL) || (*string == (char) NULL))
+ if ((string == NULL) || (*string == '\0'))
{
wmove(com_win, 0, 0);
wprintw(com_win, file_not_saved_msg);
int Counter;
temp = string;
- while (*temp != (char) NULL)
+ while (*temp != '\0')
{
if (*temp == '\\')
{
return(0);
pnt = test_line->line;
- if ((pnt == NULL) || (*pnt == (char) NULL) ||
+ if ((pnt == NULL) || (*pnt == '\0') ||
(*pnt == '.') || (*pnt == '>'))
return(0);
pnt = next_word(pnt);
}
- if (*pnt == (char) NULL)
+ if (*pnt == '\0')
return(0);
counter = 0;
- while ((*pnt != (char) NULL) && ((*pnt != ' ') && (*pnt != '\t')))
+ while ((*pnt != '\0') && ((*pnt != ' ') && (*pnt != '\t')))
{
pnt++;
counter++;
}
- while ((*pnt != (char) NULL) && ((*pnt == ' ') || (*pnt == '\t')))
+ while ((*pnt != '\0') && ((*pnt == ' ') || (*pnt == '\t')))
{
pnt++;
counter++;
{
char *full, *sub;
- for (sub = substring; (sub != NULL) && (*sub != (char)NULL); sub++)
+ for (sub = substring; (sub != NULL) && (*sub != '\0'); sub++)
{
- for (full = string; (full != NULL) && (*full != (char)NULL);
+ for (full = string; (full != NULL) && (*full != '\0');
full++)
{
if (*sub == *full)