403Webshell
Server IP : 82.208.35.60  /  Your IP : 216.73.217.116
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/math/physcalc/files/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /usr/ports/math/physcalc/files/patch-physconv.c
--- physconv.c.orig	1998-08-30 13:58:16 UTC
+++ physconv.c
@@ -32,7 +32,7 @@
 #include "physdecl.h"
 
 #ifdef __PROTOTYPES__
-LOCAL void getline(FILE *fp, char *buf);
+LOCAL void get_line(FILE *fp, char *buf);
 LOCAL int evalxpon(char *s);
 LOCAL void fixplural(char *s);
 LOCAL int output_dims(FILE *fp, int const d[MAXDIM]);
@@ -86,7 +86,7 @@ EXPORT struct dimstruct *dimension_list=
 
 /*-----Functions-----*/
 
-LOCAL void getline(fp,buf)	/* Get a line from the file & doctor it up */
+LOCAL void get_line(fp,buf)	/* Get a line from the file & doctor it up */
 FILE *fp;
 char *buf;
 {
@@ -260,12 +260,16 @@ char const *s;
 {	/* read in lines from fp and do each as if typed from console */
 	FILE *fp;
 	char buf[SMALLBUF];
+	char *fullpath;
 	int oldecho;
 #ifdef TRACE
 	int oldtrace;
 #endif
 
-	if ((fp = fopen(s,"r"))==NULL) {
+	fullpath = calloc( strlen( SHAREDIR ) + strlen( s ) + 1, 1 );
+	bcopy(SHAREDIR, fullpath, strlen(SHAREDIR));
+	(void) strcat(fullpath, s);
+	if ((fp = fopen(fullpath,"r"))==NULL) {
 		printf("Can't open %s\n",s);
 		return;
 	}
@@ -276,7 +280,7 @@ char const *s;
 #endif
 	echo = FALSE;
 	while (TRUE) {
-		getline(fp,buf);
+		get_line(fp,buf);
 		if (!buf[0])
 			break;
 		do_cmd(buf);
@@ -797,7 +801,7 @@ char const *s;
 				} else {
 					showdims(&d);
 					printf("Convert to: ");
-					gets(buf);
+					fgets(buf, sizeof(buf), stdin);
 					trimspc(buf);
 					if (buf[0]=='?') {
 						showdims(&d);

Youez - 2016 - github.com/yon3zu
LinuXploit