--- alfont-2.0.6/include/alfont.h~ 2006-11-30 13:48:16.000000000 +0100
+++ alfont-2.0.6/include/alfont.h 2006-11-30 13:48:16.000000000 +0100
@@ -10,9 +10,9 @@
/* See FTL.txt (FreeType Project License) for license */
-#define ALFONT_WINDOWS //When compiling in WINDOWS,please uncomment this line.
+//#define ALFONT_WINDOWS //When compiling in WINDOWS,please uncomment this line.
//#define ALFONT_DOS //When compiling in DOS,please uncomment this line.
-//#define ALFONT_LINUX //When compiling in LINUX,please uncomment this line.
+#define ALFONT_LINUX //When compiling in LINUX,please uncomment this line.
#ifndef ALFONT_H
@@ -461,4 +461,4 @@
Platform specifics
RISCOS-LATIN1
-*/
\ No newline at end of file
+*/
--- alfont-2.0.6/src/alfont.c~ 2006-11-30 16:12:55.000000000 +0100
+++ alfont-2.0.6/src/alfont.c 2006-11-30 16:12:55.000000000 +0100
@@ -450,7 +450,7 @@
alfont_set_char_extra_spacing(font, 0);
//Initial Font attribute
- font->language=""; /* Initial Language */
+ font->language=strdup(""); /* Initial Language */
font->type=0; /* Initial Code Convert */
font->outline_top=0; /* Initial Font top outline width */
font->outline_bottom=0; /* Initial Font bottom outline width */
@@ -530,7 +530,7 @@
alfont_set_char_extra_spacing(font, 0);
//Initial Font attribute
- font->language=""; /* Initial Language */
+ font->language=strdup(""); /* Initial Language */
font->type=0; /* Initial Code Convert */
font->outline_top=0; /* Initial Font top outline width */
font->outline_bottom=0; /* Initial Font bottom outline width */
@@ -871,7 +871,7 @@
last_glyph_index = 0;
#ifdef ALFONT_LINUX //Fix for Linux Unicode System(be converted)
- for (character = ugetxc(&(const char*)lpszW); character != 0; character = ugetxc(&(const char*)lpszW),character = ugetxc(&(const char*)lpszW)) {
+ for (character = ugetxc((const char**)&lpszW); character != 0; character = ugetxc((const char**)&lpszW),character = ugetxc((const char**)&lpszW)) {
#else
for (character = ugetxc(&(const char*)lpszW); character != 0; character = ugetxc(&(const char*)lpszW)) {
#endif
@@ -1957,7 +1957,7 @@
last_glyph_index = 0;
#ifdef ALFONT_LINUX //Fix for Linux Unicode System(be converted)
- for (character = ugetxc(&(const char*)lpszW); character != 0; character = ugetxc(&(const char*)lpszW),character = ugetxc(&(const char*)lpszW)) {
+ for (character = ugetxc((const char**)&lpszW); character != 0; character = ugetxc((const char**)&lpszW),character = ugetxc((const char**)&lpszW)) {
#else
for (character = ugetxc(&(const char*)lpszW); character != 0; character = ugetxc(&(const char*)lpszW)) {
#endif
@@ -2735,7 +2735,7 @@
/* virtually draw char by char */
last_glyph_index = 0;
#ifdef ALFONT_LINUX //Fix for Linux Unicode System(be converted)
- for (character = ugetxc(&(const char*)lpszW); character != 0; character = ugetxc(&(const char*)lpszW),character = ugetxc(&(const char*)lpszW)) {
+ for (character = ugetxc((const char**)&lpszW); character != 0; character = ugetxc((const char**)&lpszW),character = ugetxc((const char**)&lpszW)) {
#else
for (character = ugetxc(&(const char*)lpszW); character != 0; character = ugetxc(&(const char*)lpszW)) {
#endif
@@ -3712,7 +3712,9 @@
if (language == NULL) {
language = "";
}
- f->language=(char *)malloc(strlen(language)*sizeof(char));
+ if (f->language)
+ free(f->language);
+ f->language=(char *)malloc((strlen(language)+1)*sizeof(char));
strcpy(f->language,language);
}