/ Check-in [282f2a74]
Login

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:Fix a sign-extension problem for BLOB output in ".insert" mode of the command-line shell.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: 282f2a74c23aa3fca6087bdeaf5d961b4f5bbe47
User & Date: drh 2012-04-24 12:12:57
Context
2012-04-24
12:46
Move the shell test scripts into the test/ subfolder so that they are run automatically by "make test". check-in: 9fb7da69 user: drh tags: trunk
12:12
Fix a sign-extension problem for BLOB output in ".insert" mode of the command-line shell. check-in: 282f2a74 user: drh tags: trunk
2012-04-23
12:38
Update the ".table" command in the shell to show all tables in all attached databases, and to avoid using the deprecated sqlite3_get_table() function. check-in: ce2d06e2 user: drh tags: trunk
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Changes to src/shell.c.

495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
/*
** Output the given string as a hex-encoded blob (eg. X'1234' )
*/
static void output_hex_blob(FILE *out, const void *pBlob, int nBlob){
  int i;
  char *zBlob = (char *)pBlob;
  fprintf(out,"X'");
  for(i=0; i<nBlob; i++){ fprintf(out,"%02x",zBlob[i]); }
  fprintf(out,"'");
}

/*
** Output the given string as a quoted string using SQL quoting conventions.
*/
static void output_quoted_string(FILE *out, const char *z){







|







495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
/*
** Output the given string as a hex-encoded blob (eg. X'1234' )
*/
static void output_hex_blob(FILE *out, const void *pBlob, int nBlob){
  int i;
  char *zBlob = (char *)pBlob;
  fprintf(out,"X'");
  for(i=0; i<nBlob; i++){ fprintf(out,"%02x",zBlob[i]&0xff); }
  fprintf(out,"'");
}

/*
** Output the given string as a quoted string using SQL quoting conventions.
*/
static void output_quoted_string(FILE *out, const char *z){