|
Line
Link Here
|
| 0 |
-- src/fcpat.c |
0 |
++ src/fcpat.c |
|
Lines 1888-1893
Link Here
|
| 1888 |
struct objectBucket **p; |
1888 |
struct objectBucket **p; |
| 1889 |
struct objectBucket *b; |
1889 |
struct objectBucket *b; |
| 1890 |
int size; |
1890 |
int size; |
|
|
1891 |
FcChar8 *const null = 0; |
| 1891 |
|
1892 |
|
| 1892 |
for (p = &FcStrBuckets[hash % OBJECT_HASH_SIZE]; (b = *p); p = &(b->next)) |
1893 |
for (p = &FcStrBuckets[hash % OBJECT_HASH_SIZE]; (b = *p); p = &(b->next)) |
| 1893 |
if (b->hash == hash && !strcmp ((char *)s, (char *) (b + 1))) |
1894 |
if (b->hash == hash && !strcmp ((char *)s, (char *) (b + 1))) |
|
Lines 1905-1911
Link Here
|
| 1905 |
* incorrect to replace the with a memset, because the C |
1906 |
* incorrect to replace the with a memset, because the C |
| 1906 |
* specification doesn't guarantee that the null pointer is |
1907 |
* specification doesn't guarantee that the null pointer is |
| 1907 |
* the same as the zero bit pattern. */ |
1908 |
* the same as the zero bit pattern. */ |
| 1908 |
*(char **)((char *) (b + 1) + strlen((char *)s) + 1) = 0; |
1909 |
/* Misaligned pointers are not guaranteed to work, either! */ |
|
|
1910 |
memcpy (((char *) (b + 1) + strlen((char *)s) + 1), &null, sizeof (null)); |
| 1909 |
*p = b; |
1911 |
*p = b; |
| 1910 |
|
1912 |
|
| 1911 |
fcstr_count += strlen((char *)s) + 1; |
1913 |
fcstr_count += strlen((char *)s) + 1; |
|
Lines 1968-1980
Link Here
|
| 1968 |
for (p = &FcStrBuckets[hash % OBJECT_HASH_SIZE]; (b = *p); p = &(b->next)) |
1970 |
for (p = &FcStrBuckets[hash % OBJECT_HASH_SIZE]; (b = *p); p = &(b->next)) |
| 1969 |
if (b->hash == hash && !strcmp ((char *)s, (char *) (b + 1))) |
1971 |
if (b->hash == hash && !strcmp ((char *)s, (char *) (b + 1))) |
| 1970 |
{ |
1972 |
{ |
| 1971 |
FcChar8 * t = *(FcChar8 **)(((FcChar8 *)(b + 1)) + strlen ((char *)s) + 1); |
1973 |
FcChar8 * t; |
|
|
1974 |
memcpy (&t, ((FcChar8 *)(b + 1)) + strlen ((char *)s) + 1, sizeof (FcChar8 *)); |
| 1972 |
if (!t) |
1975 |
if (!t) |
| 1973 |
{ |
1976 |
{ |
| 1974 |
strcpy((char *)(static_strs[bi] + fcstr_ptr), (char *)s); |
1977 |
strcpy((char *)(static_strs[bi] + fcstr_ptr), (char *)s); |
| 1975 |
*(FcChar8 **)((FcChar8 *) (b + 1) + strlen((char *)s) + 1) = (static_strs[bi] + fcstr_ptr); |
1978 |
t = static_strs[bi] + fcstr_ptr; |
|
|
1979 |
memcpy ((FcChar8 *) (b + 1) + strlen((char *)s) + 1, &t, sizeof (FcChar8 *)); |
| 1976 |
fcstr_ptr += strlen((char *)s) + 1; |
1980 |
fcstr_ptr += strlen((char *)s) + 1; |
| 1977 |
t = *(FcChar8 **)(((FcChar8 *)(b + 1)) + strlen ((char *)s) + 1); |
1981 |
memcpy (&t, ((FcChar8 *)(b + 1)) + strlen ((char *)s) + 1, sizeof (FcChar8 *)); |
| 1978 |
} |
1982 |
} |
| 1979 |
return t; |
1983 |
return t; |
| 1980 |
} |
1984 |
} |