[libusb] HOLY CRAP IT WORKS WITH CUPS NOW!

This commit is contained in:
Solomon Peachy 2012-11-13 18:26:31 -05:00
parent 569c0476d7
commit e7f45c22b2
2 changed files with 5 additions and 6 deletions

View file

@ -25,7 +25,7 @@
*
*/
#define VERSION "0.25"
#define VERSION "0.30"
#define DEBUG( ... ) fprintf(stderr, "DEBUG: " __VA_ARGS__ )
#define ERROR( ... ) fprintf(stderr, "ERROR: " __VA_ARGS__ )

View file

@ -285,7 +285,6 @@ int main (int argc, char **argv)
int data_fd = fileno(stdin);
char *uri = getenv("DEVICE_URI");;
uint16_t use_pid = 0;
char *use_serno = NULL;
/* Static initialization */
@ -314,12 +313,12 @@ int main (int argc, char **argv)
}
/* Start parsing URI 'selphy://PID/SERIAL' */
if (strcmp(URI_PREFIX, uri)) {
ERROR("Invalid URI (%s)\n", uri);
if (strncmp(URI_PREFIX, uri, strlen(URI_PREFIX))) {
ERROR("Invalid URI prefix (%s)\n", uri);
exit(1);
}
use_pid = strtol(uri + strlen(URI_PREFIX), &use_serno, 16);
if (!use_pid || !use_serno || *use_serno != '/' || !*(use_serno+1)) {
use_serno = strchr(uri, '=');
if (!use_serno || !*(use_serno+1)) {
ERROR("Invalid URI (%s)\n", uri);
exit(1);
}