X-Git-Url: https://git.saurik.com/apple/icu.git/blobdiff_plain/374ca955a76ecab1204ca8bfa63ff9238d998416..08b89b0a244153b9f5bbb2f49c55ab0f7298122e:/icuSources/samples/uresb/uresb.c diff --git a/icuSources/samples/uresb/uresb.c b/icuSources/samples/uresb/uresb.c index 9534b96e..e1930503 100644 --- a/icuSources/samples/uresb/uresb.c +++ b/icuSources/samples/uresb/uresb.c @@ -1,7 +1,7 @@ /* ******************************************************************************* * -* Copyright (C) 1999-2004, International Business Machines +* Copyright (C) 1999-2007, International Business Machines * Corporation and others. All Rights Reserved. * ******************************************************************************* @@ -58,7 +58,7 @@ void reportError(UErrorCode *status); static UChar *quotedString(const UChar *string); void printOutBundle(UFILE *out, UResourceBundle *resource, int32_t indent, UErrorCode *status); void printIndent(UFILE *out, int32_t indent); -void printHex(UFILE *out, const uint8_t *what); +void printHex(UFILE *out, const int8_t *what); static UOption options[]={ UOPTION_HELP_H, @@ -95,9 +95,9 @@ main(int argc, char* argv[]) { "error in command line argument \"%s\"\n", argv[-argc]); } - if(argc<0 || options[0].doesOccur || options[1].doesOccur) { + if(argc<2 || options[0].doesOccur || options[1].doesOccur) { fprintf(stderr, - "usage: %s [-options]\n", + "usage: %s [-options] locale(s)\n", argv[0]); return argc<0 ? U_ILLEGAL_ARGUMENT_ERROR : U_ZERO_ERROR; } @@ -122,8 +122,8 @@ main(int argc, char* argv[]) { } } else { strcpy(resPathBuffer, currdir); - strcat(resPathBuffer, U_FILE_SEP_STRING); - strcat(resPathBuffer, "uresb"); + /*strcat(resPathBuffer, U_FILE_SEP_STRING); + strcat(resPathBuffer, "uresb");*/ resPath = resPathBuffer; /* we'll just dump uresb samples resources */ } @@ -139,7 +139,7 @@ main(int argc, char* argv[]) { } if(options[6].doesOccur) { - VERBOSE = TRUE; + VERBOSE = TRUE; } outerr = u_finit(stderr, locale, encoding); @@ -149,7 +149,7 @@ main(int argc, char* argv[]) { status = U_ZERO_ERROR; arg = getLongPathname(argv[i]); - printf("uresb: processing file \"%s\" in path \"%s\"\n", arg, resPath); + u_fprintf(out, "uresb: processing file \"%s\" in path \"%s\"\n", arg, resPath); bundle = ures_open(resPath, arg, &status); if(U_SUCCESS(status)) { u_fprintf(out, "%s\n", arg); @@ -178,8 +178,8 @@ void printIndent(UFILE *out, int32_t indent) { u_fprintf(out, "%s", inchar); } -void printHex(UFILE *out, const uint8_t *what) { - u_fprintf(out, "%02X", *what); +void printHex(UFILE *out, const int8_t *what) { + u_fprintf(out, "%02X", (uint8_t)*what); } static UChar *quotedString(const UChar *string) { @@ -219,7 +219,6 @@ static UChar *quotedString(const UChar *string) { } void printOutBundle(UFILE *out, UResourceBundle *resource, int32_t indent, UErrorCode *status) { - int32_t noOfElements = ures_getSize(resource); int32_t i = 0; const char *key = ures_getKey(resource); @@ -355,7 +354,7 @@ void printOutBundle(UFILE *out, UResourceBundle *resource, int32_t indent, UErro } void reportError(UErrorCode *status) { - u_fprintf(outerr, "Error %d : %U happened!\n", *status, getErrorName(*status)); + u_fprintf(outerr, "Error %d(%s) : %U happened!\n", *status, u_errorName(*status), getErrorName(*status)); }