diff --git a/LICENSE b/LICENSE index 333f75d..e4f2330 100644 --- a/LICENSE +++ b/LICENSE @@ -6,6 +6,7 @@ MIT/X Consortium License © 2011 Rob Pilling © 2011 Hiltjo Posthuma © 2011 pancake +© 2011 Random832 Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), diff --git a/util/enmasse.c b/util/enmasse.c index 6136c45..dbbbdbb 100644 --- a/util/enmasse.c +++ b/util/enmasse.c @@ -21,17 +21,16 @@ enmasse(int argc, char **argv, int (*fn)(const char *, const char *)) fnck(argv[0], argv[1], fn); return; } - else if(argc == 1) - dir = "."; else - dir = argv[--argc]; + dir = (argc == 1) ? "." : argv[--argc]; if((size = pathconf(dir, _PC_PATH_MAX)) == -1) size = BUFSIZ; if(!(buf = malloc(size))) eprintf("malloc:"); for(i = 0; i < argc; i++) { - snprintf(buf, size, "%s/%s", dir, basename(argv[i])); + if(snprintf(buf, size, "%s/%s", dir, basename(argv[i])) > size) + eprintf("%s/%s: filename too long\n", dir, basename(argv[i])); fnck(argv[i], buf, fn); } free(buf);