#include <signal.h>
#include <sys/stat.h>
#include <locale.h>
+#include <stdlib.h>
#define PRINT_MESSAGES \
{ puts (DtSearchGetMessages()); DtSearchFreeMessages(); }
return FALSE;
}
- strcpy (parsed_dbname, ptr);
+ snprintf(parsed_dbname, sizeof(parsed_dbname), "%s", ptr);
parsed_dblk = usrblk.dblk;
/* Hop over to beginning of 2nd token */
"\n...push ENTER to continue... ") );
*userbuf = '\0';
- fgets (userbuf, sizeof (userbuf), stdin);
+ if(NULL == fgets (userbuf, sizeof (userbuf), stdin)) {
+ fprintf(stderr, "Failed to read from stdin\n");
+ exit(EXIT_FAILURE);
+ }
if (strlen(userbuf) && userbuf[strlen(userbuf)-1] == '\n')
userbuf[strlen(userbuf)-1] = '\0';
"\n...push ENTER to continue... ") );
*userbuf = '\0';
- fgets (userbuf, sizeof (userbuf), stdin);
- if (strlen(userbuf) &&
+ if(NULL == fgets (userbuf, sizeof (userbuf), stdin)) {
+ fprintf(stderr, "Failed to read from stdin 2\n");
+ exit(EXIT_FAILURE);
+ }
+
+ if (strlen(userbuf) &&
userbuf[strlen(userbuf)-1] == '\n')
userbuf[strlen(userbuf)-1] = '\0';
"If you are sure you are ready to start deleting, enter 'y' now... ") ,
infname, OE_prodname);
- fgets (buf, sizeof(buf)-1, stdin);
+ if(NULL == fgets (buf, sizeof(buf)-1, stdin)) {
+ fprintf(stderr, "no input\n");
+ return;
+ }
if (tolower (*buf) != 'y')
return;
}