tpd->boldTermFont =
_DtTermPrimRenderFontCreate(w, tw->term.boldFont);
}
- if (fontName) XFree(fontName) ;
+ XFree(fontName) ;
}
}
}
** we ran out of memory, no need try and resize the
** term buffer
*/
- resizeTermBuffer == False;
+ resizeTermBuffer = False;
}
}
{
DtTermPrimitiveWidget tw = (DtTermPrimitiveWidget) w;
DtTermPrimData tpd = tw->term.tpd;
- unsigned char *buffer = (unsigned char *) 0;
int fd = tw->term.pty;
switch (event->type) {
/* reinstall the pty input select... */
(void) _DtTermPrimStartOrStopPtyInput(w);
-
- /* free the old buffer... */
- if (buffer) {
- (void) XtFree((char *) buffer);
- }
if ((tpd->scroll.nojump.pendingScroll == 0) &&
!moreInput(tw->term.pty)) {
if (newEnv == NULL)
{
printf("L10n MALLOC ERROR\n");
+ return NULL;
}
/*
char buffer[BUFSIZ];
char *c;
- (void) strcpy(buffer, c1);
- (void) strcat(buffer, c2);
+ snprintf(buffer, sizeof(buffer), "%s%s", c1, c2);
c = XtMalloc(strlen(buffer) + 1);
(void) strcpy(c, buffer);
(void) putenv(c);
** its a null character, but is still has a width for our
** purposes...
*/
- charWidth == 1;
+ charWidth = 1;
break;
default:
break;
#else /* linux */
- chown(ptySlave, getuid(), getgid());
- chmod(ptySlave, 0622);
+ if(chown(ptySlave, getuid(), getgid()) == -1) {
+ (void) perror("Error performing chown()");
+ /* exit the subprocess */
+ return(1);
+ }
+ if(chmod(ptySlave, 0622) == -1) {
+ (void) perror("Error performing chmod()");
+ /* exit the subprocess */
+ return(1);
+ }
#endif /* linux */
/* success... */
selectColEnd = (selectInfo->end - 1) % (selectInfo->columns + 1);
DebugF('c', 1,
- fprintf(stderr, "set selection units: %d-%d lines: %d-%d\n",
+ fprintf(stderr, "set selection units: %ld-%ld lines: %d-%d\n",
selectInfo->begin, selectInfo->end,
selectLineBegin,
selectLineEnd));
if (malloc_size != 0) XtFree(total_tmp_value);
(void) _DtTermPrimCursorOn(w);
+
+ return True;
}
/* This is the event interface for paste clipboard */
/* we got a valid reference tty... */
DebugF('p', 3, fprintf(stderr,
">>_DtTermPrimPtyGetDefaultModes() valid reference \"/dev/tty\"\n"));
- refTty = tty;
refValid = 1;
}
}
utPtr->ut_exit.e_exit = 2;
#endif
- (void) strncpy(utPtr->ut_user, (userName && *userName) ? userName : "????",
- sizeof(utPtr->ut_user));
+ snprintf(utPtr->ut_user, sizeof(utPtr->ut_user),
+ "%s", (userName && *userName) ? userName : "????");
(void) strncpy(utPtr->ut_line, utmpLine, sizeof(utPtr->ut_line));
utPtr->ut_pid = pid;
(void) time(&now);
time_t now;
ut.ut_type = USER_PROCESS;
- (void) strncpy(ut.ut_line, utmpLine, sizeof(ut.ut_line));
+ snprintf(ut.ut_line, sizeof(ut.ut_line), "%s", utmpLine);
(void) setutent();
if (utPtr = getutline(&ut)) {
utPtr->ut_type = DEAD_PROCESS;
for (logInfoTmp = logInfoHead->next; logInfoTmp;
logInfoTmp = logInfoTmp->next) {
DebugF('s', 10, fprintf(stderr,
- ">>flushing logfile 0x%lx\n", logInfoTmp->logFile));
+ ">>flushing logfile %p\n", logInfoTmp->logFile));
(void) fflush(logInfoTmp->logFile);
}
_DtTermProcessUnlock();
c = "<unknown>";
}
- (void) printf("GeometryManager: %s widget (0x%lx) requesting geo change\n",
+ (void) printf("GeometryManager: %s widget (%p) requesting geo change\n",
c, child);
return(XtGeometryNo);
}
/* get a mnemonic for "Default"... */
- (void) strcpy(buffer, (GETMESSAGE(NL_SETN_ViewMenu,1, "Default")));
+ snprintf(buffer, sizeof(buffer), "%s", (GETMESSAGE(NL_SETN_ViewMenu,1, "Default")));
#ifdef NOTDEF
for (c2 = buffer; *c2; c2++) {
if (!strchr(mnemonics, *c2) && !isspace(*c2))
0, NULL, NULL, fontChangeCallback, (XtPointer) i1);
}
- (void) strcpy(buffer, (GETMESSAGE(NL_SETN_ViewMenu,9, "Default")));
+ snprintf(buffer, sizeof(buffer), "%s", (GETMESSAGE(NL_SETN_ViewMenu,9, "Default")));
fontSizeToggles[i1] = _DtTermViewCreateToggleButton(submenu, buffer,
0, NULL, NULL, defaultFontCallback, NULL);
fontSizeTogglesDefault = i1;
}
/* back up buffer... */
- (void) strncpy(orig, buffer, BUFSIZ);
+ (void) strncpy(orig, buffer, BUFSIZ - 1);
bufPtr = buffer;