Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
freebsd
GitHub Repository: freebsd/freebsd-ports-kde
Path: blob/main/japanese/edict/files/patch-xjdxgen.c
16461 views
1
--- xjdxgen.c.orig 1998-09-11 03:04:21 UTC
2
+++ xjdxgen.c
3
@@ -23,7 +23,7 @@
4
#include <sys/stat.h>
5
6
#include <stdio.h>
7
-/*#include <stdlib.h>*/
8
+#include <stdlib.h>
9
#include <ctype.h>
10
#include <string.h>
11
#include "xjdic.h"
12
@@ -154,7 +154,7 @@ unsigned char **argv;
13
db[diclen] = 10;
14
db[0] = 10;
15
printf("Dictionary size: %ld bytes.\n",dbyte);
16
- indlen = (diclen * 3)/4;
17
+ indlen = (diclen * 3*(sizeof(long)/4))/4;
18
jindex = (unsigned long *)malloc(indlen);
19
if(jindex == NULL)
20
{
21
@@ -273,6 +273,7 @@ unsigned char **argv;
22
jindex[0] = diclen+jiver;
23
fwrite(jindex,sizeof(long),indptr+1,fp);
24
fclose(fp);
25
+ return (0);
26
}
27
/*======function to sort jindex table====================*/
28
void jqsort(long lhs, long rhs)
29
30