A couple of fixes for file "main.m" in the "seticon" utility:
The first change is at line 119. No encoding is specified for the
NSString built from the command line parameters, which leads to failure
if the string contains unusual characters. Specifying UTF8 fixes this:
dstPath = [NSString stringWithCString: (char *)argv[optind]
The second I *think* is a bug; line 100 reads the icon source path from
index "optind", but does not also increment "optind". This means the
processing loop later on applies the icon both back to the icon source
file, as well as the real file or folder which the user had expected to
alter. Changing line 100 as follows prevents this:
(char *)src = (char *)argv[optind];
src = (char *)argv[optind++];
Note the cast is removed because it is unnecessary ("src" is already a
"char *") and Xcode warns about it, saying that it will become a hard
error in future.
Log in to post a comment.