aboutsummaryrefslogtreecommitdiff
path: root/editors
diff options
context:
space:
mode:
Diffstat (limited to 'editors')
-rw-r--r--editors/awk.c6
-rw-r--r--editors/sed.c2
-rw-r--r--editors/vi.c8
3 files changed, 8 insertions, 8 deletions
diff --git a/editors/awk.c b/editors/awk.c
index 147c621ab..81ca9daf7 100644
--- a/editors/awk.c
+++ b/editors/awk.c
@@ -781,7 +781,7 @@ static var *nvalloc(int n)
781 781
782 if (! cb) { 782 if (! cb) {
783 size = (n <= MINNVBLOCK) ? MINNVBLOCK : n; 783 size = (n <= MINNVBLOCK) ? MINNVBLOCK : n;
784 cb = (nvblock *)xmalloc(sizeof(nvblock) + size * sizeof(var)); 784 cb = xmalloc(sizeof(nvblock) + size * sizeof(var));
785 cb->size = size; 785 cb->size = size;
786 cb->pos = cb->nv; 786 cb->pos = cb->nv;
787 cb->prev = pb; 787 cb->prev = pb;
@@ -2463,7 +2463,7 @@ re_cont:
2463 case XC( OC_CONCAT ): 2463 case XC( OC_CONCAT ):
2464 case XC( OC_COMMA ): 2464 case XC( OC_COMMA ):
2465 opn = strlen(L.s) + strlen(R.s) + 2; 2465 opn = strlen(L.s) + strlen(R.s) + 2;
2466 X.s = (char *)xmalloc(opn); 2466 X.s = xmalloc(opn);
2467 strcpy(X.s, L.s); 2467 strcpy(X.s, L.s);
2468 if ((opinfo & OPCLSMASK) == OC_COMMA) { 2468 if ((opinfo & OPCLSMASK) == OC_COMMA) {
2469 L.s = getvar_s(V[SUBSEP]); 2469 L.s = getvar_s(V[SUBSEP]);
@@ -2702,7 +2702,7 @@ keep_going:
2702 /* one byte is reserved for some trick in next_token */ 2702 /* one byte is reserved for some trick in next_token */
2703 if (fseek(F, 0, SEEK_END) == 0) { 2703 if (fseek(F, 0, SEEK_END) == 0) {
2704 flen = ftell(F); 2704 flen = ftell(F);
2705 s = (char *)xmalloc(flen+4); 2705 s = xmalloc(flen+4);
2706 fseek(F, 0, SEEK_SET); 2706 fseek(F, 0, SEEK_SET);
2707 i = 1 + fread(s+1, 1, flen, F); 2707 i = 1 + fread(s+1, 1, flen, F);
2708 } else { 2708 } else {
diff --git a/editors/sed.c b/editors/sed.c
index 8d372abe4..95ced1ceb 100644
--- a/editors/sed.c
+++ b/editors/sed.c
@@ -382,7 +382,7 @@ out:
382 /* compile the match string into a regex */ 382 /* compile the match string into a regex */
383 if (*match != '\0') { 383 if (*match != '\0') {
384 /* If match is empty, we use last regex used at runtime */ 384 /* If match is empty, we use last regex used at runtime */
385 sed_cmd->sub_match = (regex_t *) xmalloc(sizeof(regex_t)); 385 sed_cmd->sub_match = xmalloc(sizeof(regex_t));
386 xregcomp(sed_cmd->sub_match, match, cflags); 386 xregcomp(sed_cmd->sub_match, match, cflags);
387 } 387 }
388 free(match); 388 free(match);
diff --git a/editors/vi.c b/editors/vi.c
index 0bb2b23ef..1122f9919 100644
--- a/editors/vi.c
+++ b/editors/vi.c
@@ -1370,7 +1370,7 @@ static Byte *new_screen(int ro, int co)
1370 1370
1371 free(screen); 1371 free(screen);
1372 screensize = ro * co + 8; 1372 screensize = ro * co + 8;
1373 screen = (Byte *) xmalloc(screensize); 1373 screen = xmalloc(screensize);
1374 // initialize the new screen. assume this will be a empty file. 1374 // initialize the new screen. assume this will be a empty file.
1375 screen_erase(); 1375 screen_erase();
1376 // non-existent text[] lines start with a tilde (~). 1376 // non-existent text[] lines start with a tilde (~).
@@ -1385,7 +1385,7 @@ static Byte *new_text(int size)
1385 if (size < 10240) 1385 if (size < 10240)
1386 size = 10240; // have a minimum size for new files 1386 size = 10240; // have a minimum size for new files
1387 free(text); 1387 free(text);
1388 text = (Byte *) xmalloc(size + 8); 1388 text = xmalloc(size + 8);
1389 memset(text, '\0', size); // clear new text[] 1389 memset(text, '\0', size); // clear new text[]
1390 //text += 4; // leave some room for "oops" 1390 //text += 4; // leave some room for "oops"
1391 return text; 1391 return text;
@@ -1901,7 +1901,7 @@ static void start_new_cmd_q(Byte c)
1901 // release old cmd 1901 // release old cmd
1902 free(last_modifying_cmd); 1902 free(last_modifying_cmd);
1903 // get buffer for new cmd 1903 // get buffer for new cmd
1904 last_modifying_cmd = (Byte *) xmalloc(BUFSIZ); 1904 last_modifying_cmd = xmalloc(BUFSIZ);
1905 memset(last_modifying_cmd, '\0', BUFSIZ); // clear new cmd queue 1905 memset(last_modifying_cmd, '\0', BUFSIZ); // clear new cmd queue
1906 // if there is a current cmd count put it in the buffer first 1906 // if there is a current cmd count put it in the buffer first
1907 if (cmdcnt > 0) 1907 if (cmdcnt > 0)
@@ -1954,7 +1954,7 @@ static Byte *text_yank(Byte * p, Byte * q, int dest) // copy text into a registe
1954 cnt = q - p + 1; 1954 cnt = q - p + 1;
1955 t = reg[dest]; 1955 t = reg[dest];
1956 free(t); // if already a yank register, free it 1956 free(t); // if already a yank register, free it
1957 t = (Byte *) xmalloc(cnt + 1); // get a new register 1957 t = xmalloc(cnt + 1); // get a new register
1958 memset(t, '\0', cnt + 1); // clear new text[] 1958 memset(t, '\0', cnt + 1); // clear new text[]
1959 strncpy((char *) t, (char *) p, cnt); // copy text[] into bufer 1959 strncpy((char *) t, (char *) p, cnt); // copy text[] into bufer
1960 reg[dest] = t; 1960 reg[dest] = t;