Age | Commit message (Collapse) | Author |
|
|
|
|
|
ident.c:84:13: warning: implicit conversion loses integer precision:
'unsigned long' to 'int' [-Wshorten-64-to-32]
int n = strlen(filename);
~ ^~~~~~~~~~~~~~~~
ident.c:130:9: warning: implicit conversion loses integer precision:
'off64_t' (aka 'long') to 'int' [-Wshorten-64-to-32]
return gzseek(ff->f.gz, offset, whence);
~~~~~~ ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
ident.c:140:17: warning: implicit conversion loses integer precision:
'long' to 'int' [-Wshorten-64-to-32]
n = offset - ff->pos;
~ ~~~~~~~^~~~~~~~~
ident.c:143:10: warning: implicit conversion loses integer precision:
'off_t' (aka 'long') to 'int' [-Wshorten-64-to-32]
n = offset;
~ ^~~~~~
ident.c:156:12: warning: implicit conversion loses integer precision:
'off_t' (aka 'long') to 'unsigned int' [-Wshorten-64-to-32]
ff->pos = offset;
~ ^~~~~~
ident.c:157:9: warning: implicit conversion loses integer precision:
'off_t' (aka 'long') to 'int' [-Wshorten-64-to-32]
return offset;
~~~~~~ ^~~~~~
mkfontscale.c:704:13: warning: implicit conversion loses integer precision:
'unsigned long' to 'int' [-Wshorten-64-to-32]
int n = strlen(dirname);
~ ^~~~~~~~~~~~~~~
mkfontscale.c:748:13: warning: implicit conversion loses integer precision:
'unsigned long' to 'int' [-Wshorten-64-to-32]
int n = strlen(filename);
~ ^~~~~~~~~~~~~~~~
mkfontscale.c:794:14: warning: implicit conversion loses integer precision:
'unsigned long' to 'int' [-Wshorten-64-to-32]
xl = strlen (exclusionSuffix);
~ ^~~~~~~~~~~~~~~~~~~~~~~~
mkfontscale.c:796:9: warning: implicit conversion loses integer precision:
'unsigned long' to 'int' [-Wshorten-64-to-32]
i = strlen(dirname_given);
~ ^~~~~~~~~~~~~~~~~~~~~
mkfontscale.c:858:15: warning: implicit conversion loses integer precision:
'unsigned long' to 'int' [-Wshorten-64-to-32]
int dl = strlen (entry->d_name);
~~ ^~~~~~~~~~~~~~~~~~~~~~
mkfontscale.c:930:21: warning: implicit conversion loses integer precision:
'unsigned long' to 'int' [-Wshorten-64-to-32]
int l = strlen(xlfd_name);
~ ^~~~~~~~~~~~~~~~~
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
|
|
mkfontscale.c: In function ‘getName’:
mkfontscale.c:336:22: warning: comparison between signed and unsigned
integer expressions [-Wsign-compare]
for(i = 0; i < name.string_len / 2; i++) {
^
mkfontscale.c: In function ‘nameWidth’:
mkfontscale.c:427:18: warning: comparison between signed and unsigned
integer expressions [-Wsign-compare]
for(i = 0; i < NUMWIDTHS; i++)
^
mkfontscale.c: In function ‘notice_foundry’:
mkfontscale.c:1261:18: warning: comparison between signed and unsigned
integer expressions [-Wsign-compare]
for(i = 0; i < countof(notice_foundries); i++)
^
mkfontscale.c: In function ‘vendor_foundry’:
mkfontscale.c:1285:18: warning: comparison between signed and unsigned
integer expressions [-Wsign-compare]
for(i = 0; i < countof(vendor_foundries); i++)
^
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
|
|
Gets rid of lots of const warnings.
Signed-off-by: Thomas Klausner <wiz@NetBSD.org>
|
|
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
|
|
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
|
|
mkfontscale.c: In function ‘checkExtraEncoding’:
mkfontscale.c:1220:17: warning: declaration of ‘found’ shadows a parameter [-Wshadow]
int found = 0;
^~~~~
mkfontscale.c:1214:59: note: shadowed declaration is here
checkExtraEncoding(FT_Face face, char *encoding_name, int found)
^~~~~
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
|
|
mkfontscale.c: In function ‘doDirectory’:
mkfontscale.c:928:17: warning: declaration of ‘n’ shadows a previous local [-Wshadow]
int n = strlen(xlfd_name);
^
mkfontscale.c:788:12: note: shadowed declaration is here
int i, n, dirn, diri, found, rc;
^
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
|
|
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
|
|
dsprintf is an allocating sprintf. With a format string of "%s", it
reduces to just being a more complicated version of strdup, so lets
just use strdup instead to save time and reduce complexity.
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
|
|
If getcwd returned a string that exactly filled the prefix buffer,
it could write the null terminator byte out of bounds.
Instead, since the prefix is copied to a newly allocated string and
never used again, just let the dsprintf() call take care of it.
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
|
|
so that openSUSE's installation-images builds in a reproducible way
in spite of indeterministic filesystem readdir order
See https://reproducible-builds.org/ for why this is good.
Signed-off-by: Bernhard M. Wiedemann <bwiedemann@suse.de>
|
|
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
|
|
Signed-off-by: Mihail Konev <k.mvc@ya.ru>
|
|
Place quotes around the $srcdir, $ORIGDIR and $0 variables to prevent
fall-outs, when they contain space.
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
|
|
Syncs the invocation of configure with the one from the server.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Emil Velikov <emil.velikov@collabora.com>
|
|
https://bugs.freedesktop.org/show_bug.cgi?id=96905
=================================================================
==3068==ERROR: AddressSanitizer: heap-buffer-overflow on address 0x60300000de6f at pc 0x000109df79d1 bp 0x7fff55e37d90 sp 0x7fff55e37550
READ of size 1 at 0x60300000de6f thread T0
#0 0x109df79d0 in wrap_strcmp (libclang_rt.asan_osx_dynamic.dylib+0xe9d0)
#1 0x109dc8ef7 in fontFileOpen (mkfontscale+0x100001ef7)
#2 0x109dc8e0b in bitmapIdentify (mkfontscale+0x100001e0b)
#3 0x109dcc874 in doDirectory (mkfontscale+0x100005874)
#4 0x109dcbc78 in main (mkfontscale+0x100004c78)
#5 0x7fff9083f5ac in start (libdyld.dylib+0x35ac)
#6 0x3 (<unknown module>)
0x60300000de6f is located 1 bytes to the left of 20-byte region [0x60300000de70,0x60300000de84)
allocated by thread T0 here:
#0 0x109e34570 in wrap_malloc (libclang_rt.asan_osx_dynamic.dylib+0x4b570)
#1 0x109dca92a in dsprintf (mkfontscale+0x10000392a)
#2 0x109dcc788 in doDirectory (mkfontscale+0x100005788)
#3 0x109dcbc78 in main (mkfontscale+0x100004c78)
#4 0x7fff9083f5ac in start (libdyld.dylib+0x35ac)
#5 0x3 (<unknown module>)
Signed-off-by: Jeremy Huddleston Sequoia <jeremyhu@apple.com>
|
|
https://bugzilla.opensuse.org/show_bug.cgi?id=918466
Signed-off-by: Stefan Dirsch <sndirsch@suse.de>
Reviewed-by: Adam Jackson <ajax@redhat.com>
|
|
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
|
|
Flagged by cppcheck 1.65:
[mkfontscale.c:247]: (style) Expression is always false because
'else if' condition matches previous condition at line 224.
[mkfontscale.c:245]: (style) Expression is always false because
'else if' condition matches previous condition at line 227.
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
|
|
See http://people.gnome.org/~walters/docs/build-api.txt
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
|
|
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
|
|
Reviewed-by: Gaetan Nadon <memsize@videotron.ca>
Signed-off-by: Thomas Klausner <wiz@NetBSD.org>
|
|
list.c:238:23: warning: Call to 'malloc' has an allocation size of 0 bytes
ListPtr *sorted = malloc(l * sizeof(ListPtr));
^~~~~~~~~~~~~~~~~~~~~~~~~~~
Signed-off-by: Jeremy Huddleston Sequoia <jeremyhu@apple.com>
|
|
mkfontscale.c:635:25: warning: Potential leak of memory pointed to by 'notice'
foundry = notice_foundry(notice);
~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~
mkfontscale.c:640:8: warning: Potential leak of memory pointed to by 'notice'
if(strcmp(slant, "i") == 0) {
^~~~~~
Signed-off-by: Jeremy Huddleston Sequoia <jeremyhu@apple.com>
|
|
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Reviewed-by: Gaetan Nadon <memsize@videotron.ca>
|
|
Avoid duplicating exit(1) calls after every single call to usage()
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Reviewed-by: Gaetan Nadon <memsize@videotron.ca>
|
|
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Reviewed-by: Gaetan Nadon <memsize@videotron.ca>
|
|
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Reviewed-by: Gaetan Nadon <memsize@videotron.ca>
|
|
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
|
|
Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
|
|
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
|
|
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
|
|
Clears clang warnings:
hash.c:82:13: warning: implicit conversion changes signedness: 'unsigned int' to 'int' [-Wsign-conversion]
int i = hash(key);
~ ^~~~~~~~~
hash.c:94:13: warning: implicit conversion changes signedness: 'unsigned int' to 'int' [-Wsign-conversion]
int i = hash(key);
~ ^~~~~~~~~
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
|
|
Fix compilation for MinGW since 9cbe3256bc932b82f2435b23cda0931f4f5f5ba2
Unfortunately, MinGW doesn't define S_ISLNK, so check for that as well.
Signed-off-by: Egbert Eich <eich@freedesktop.org>
Reviewed-by: Colin Harrison <colin.harrison at virgin.net>
|
|
If a symlink to a fontfile in the same directory exists the file
that got picked depends on the order in which readdir() picked
entries.
This patch gives the file a higher preference than the symlink to
it so it will be preferred if the xlfd entries match.
v2: Followed a suggestion by Julien Cristau <jcristau@debian.org>
to check for DT_LNK being defined instead of _BSD_SOURCE
and fall back to lstat() if d_type is DT_UNKNOWN.
Signed-off-by: Egbert Eich <eich@freedesktop.org>
|
|
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
|
|
Culmus must precede URW and Bitstream in notice list, since its fonts are
based on URW/Bitstream sometimes.
Signed-off-by: Maxim Iorsh <iorsh@users.sourceforge.net>
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
|
|
Maps fonts produced by the Culmus project <http://culmus.sourceforge.net>
to the XLFD foundry name "culmus"
For TrueType fonts, maps the vendor code "CLM" from the TrueType vendor
id field.
For Type1 fonts, which use heuristics to guess mappings to XLFD foundries
from words in the copyright notice, add the names of the main contributors
to the Culmus product to recognize the fonts under their copyright.
Signed-off-by: Maxim Iorsh <iorsh@users.sourceforge.net>
Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
|
|
Performed with: find * -type f | xargs perl -i -p -e 's{[ \t]+$}{}'
git diff -w & git diff -b show no diffs from this change
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
|
|
Does not fix all of them since some lists contain constant strings and
some contain dynamically allocated strings that need to be freed later.
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
|
|
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
|
|
Fontforge uses 'ExtraLight' and 'Heavy' weights in Type 1 fonts, which
should be understood by mkfontscale. Other FontForge designations are
already addressed.
Signed-off-by: Maxim Iorsh <iorsh@users.sourceforge.net>
Reviewed-by: Jeremy Huddleston <jeremyhu@apple.com>
|
|
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
|
|
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Reviewed-by: Jeremy Huddleston <jeremyhu@apple.com>
|
|
have_face is initialized to 0 at the beginning of the loop, so no need to set
it to 0 just before it goes out of scope at the end of the loop.
mkfontscale.c:945:13: warning: Value stored to 'have_face' is never read
have_face = 0;
^ ~
Found-by: clang static analyzer
Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com>
|
|
Error: Memory leak (CWE 401)
Memory leak of pointer 'first' allocated with malloc(8)
at line 192 of list.c in function 'makeList'.
'first' allocated at line 181 with malloc(8).
first leaks when next == 0 at line 191.
[ This bug was found by the Parfait 0.3.6 bug checking tool.
For more information see http://labs.oracle.com/projects/parfait/ ]
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Reviewed-by: Julien Cristau <jcristau@debian.org>
|
|
fscanf %s arguments don't include the trailing \0 byte in their counts.
Error: Buffer overrun
Buffer overflow (CWE 120): Use of fscanf(%1024[), with buffer 'font'
Array size is 1024 bytes
at line 707 of mkfontscale.c in function 'readFontScale'.
Buffer overflow (CWE 120): Use of fscanf(%1024s), with buffer 'file'
Array size is 1024 bytes
at line 707 of mkfontscale.c in function 'readFontScale'.
[ This bug was found by the Parfait 0.3.6 bug checking tool.
For more information see http://labs.oracle.com/projects/parfait/ ]
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Reviewed-by: Julien Cristau <jcristau@debian.org>
|
|
Allows easier comparison between builds to detect changes.
Helps reduce deltas in packaging systems that compare old & new versions.
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
|