#include "includes.h"
#include "web/swat_proto.h"
+#include "intl/lang_tdb.h"
/*
during a file download we first check to see if there is a language
char *lang = lang_tdb_current();
int fd;
if (lang) {
- asprintf(&p, "lang/%s/%s", lang, fname);
- if (p) {
+ if (asprintf(&p, "lang/%s/%s", lang, fname) != -1) {
fd = sys_open(p, flags, mode);
free(p);
if (fd != -1) {
char *string;
};
-static int qsort_cmp_list(const void *x, const void *y) {
- struct pri_list *a = (struct pri_list *)x;
- struct pri_list *b = (struct pri_list *)y;
+static int qsort_cmp_list(struct pri_list *a, struct pri_list *b)
+{
if (a->pri > b->pri) return -1;
if (a->pri < b->pri) return 1;
return 0;
int lang_num, i;
/* build the lang list */
- lang_list = str_list_make(talloc_tos(), lang_string, ", \t\r\n");
+ lang_list = str_list_make_v3(talloc_tos(), lang_string, ", \t\r\n");
if (!lang_list) return;
/* sort the list by priority */
}
TALLOC_FREE(lang_list);
- qsort(pl, lang_num, sizeof(struct pri_list), &qsort_cmp_list);
+ TYPESAFE_QSORT(pl, lang_num, qsort_cmp_list);
/* it's not an error to not initialise - we just fall back to
the default */