Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
freebsd
GitHub Repository: freebsd/freebsd-ports-gnome
Path: blob/main/converters/mpack/files/patch-encode.c
16151 views
1
--- encode.c.orig Mon Jul 21 23:35:31 2003
2
+++ encode.c Sun Mar 26 22:54:13 2006
3
@@ -23,12 +23,15 @@
4
* SOFTWARE.
5
*/
6
#include <stdio.h>
7
+#include <stdlib.h>
8
#include <string.h>
9
10
extern char *magic_look(FILE *infile);
11
extern char *os_genid(void);
12
extern FILE *os_createnewfile(char *fname);
13
extern char *md5digest(FILE *infile, long int *len);
14
+extern void os_perror(char *str);
15
+extern int to64(FILE *infile, FILE *outfile, long int limit);
16
17
#define NUMREFERENCES 4
18
19
@@ -43,7 +46,7 @@
20
char *type;
21
FILE *outfile;
22
char *cleanfname, *p;
23
- char *digest, *appledigest;
24
+ char *digest, *appledigest = NULL;
25
long filesize, l, written;
26
int thispart, numparts = 1;
27
int wrotefiletype = 0;
28
@@ -59,10 +62,10 @@
29
*/
30
if (p = strrchr(cleanfname, '.')) cleanfname = p+1;
31
#else
32
- if (p = strrchr(cleanfname, '/')) cleanfname = p+1;
33
- if (p = strrchr(cleanfname, '\\')) cleanfname = p+1;
34
+ if ((p = strrchr(cleanfname, '/'))) cleanfname = p+1;
35
+ if ((p = strrchr(cleanfname, '\\'))) cleanfname = p+1;
36
#endif
37
- if (p = strrchr(cleanfname, ':')) cleanfname = p+1;
38
+ if ((p = strrchr(cleanfname, ':'))) cleanfname = p+1;
39
40
/* Find file type */
41
if (typeoverride) {
42
43