/ Check-in [9c424a5c]
Login

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

Overview
Comment:Correct help text and make consistent use of snprintf.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | asciiMode
Files: files | file ages | folders
SHA1: 9c424a5c50e4a2ed36556e99fba0e7072a2d3468
User & Date: mistachkin 2014-07-24 22:51:18
Context
2014-09-01
01:15
Merge updates from trunk. check-in: 51f33cf1 user: mistachkin tags: asciiMode
2014-07-24
22:51
Correct help text and make consistent use of snprintf. check-in: 9c424a5c user: mistachkin tags: asciiMode
22:33
Update a shell test case. check-in: b84008cb user: mistachkin tags: asciiMode
Changes
Hide Diffs Side-by-Side Diffs Ignore Whitespace Patch

Changes to src/shell.c.

  3221   3221       }
  3222   3222     }else
  3223   3223   #endif
  3224   3224   
  3225   3225     if( c=='r' && strncmp(azArg[0], "rowseparator", n)==0 ){
  3226   3226       if( nArg==2 ){
  3227   3227         sqlite3_snprintf(sizeof(p->rowSeparator), p->rowSeparator,
  3228         -                       "%.*s", (int)sizeof(p->rowSeparator)-1, azArg[1]);
         3228  +                       "%.*s", (int)ArraySize(p->rowSeparator)-1, azArg[1]);
  3229   3229       }else{
  3230   3230         fprintf(stderr, "Usage: .rowseparator STRING\n");
  3231   3231         rc = 1;
  3232   3232       }
  3233   3233     }else
  3234   3234   
  3235   3235     if( c=='c' && strncmp(azArg[0], "colseparator", n)==0 ){
  3236   3236       if( nArg==2 ){
  3237   3237         sqlite3_snprintf(sizeof(p->colSeparator), p->colSeparator,
  3238         -                       "%.*s", (int)sizeof(p->colSeparator)-1, azArg[1]);
         3238  +                       "%.*s", (int)ArraySize(p->colSeparator)-1, azArg[1]);
  3239   3239       }else{
  3240   3240         fprintf(stderr, "Usage: .colseparator STRING\n");
  3241   3241         rc = 1;
  3242   3242       }
  3243   3243     }else
  3244   3244   
  3245   3245     if( c=='s' && strncmp(azArg[0], "separator", n)==0 ){
  3246   3246       if( nArg<2 || nArg>3 ){
  3247   3247         fprintf(stderr, "Usage: .separator SEPARATOR ?NEWLINE?\n");
  3248   3248         rc = 1;
  3249   3249       }
  3250   3250       if( nArg>=2 ){
  3251   3251         sqlite3_snprintf(sizeof(p->colSeparator), p->colSeparator,
  3252         -                       "%.*s", (int)sizeof(p->colSeparator)-1, azArg[1]);
         3252  +                       "%.*s", (int)ArraySize(p->colSeparator)-1, azArg[1]);
  3253   3253       }
  3254   3254       if( nArg>=3 ){
  3255   3255         sqlite3_snprintf(sizeof(p->newline), p->newline,
  3256         -                       "%.*s", (int)sizeof(p->newline)-1, azArg[2]);
         3256  +                       "%.*s", (int)ArraySize(p->newline)-1, azArg[2]);
  3257   3257       }
  3258   3258     }else
  3259   3259   
  3260   3260     if( c=='s'
  3261   3261      && (strncmp(azArg[0], "shell", n)==0 || strncmp(azArg[0],"system",n)==0)
  3262   3262     ){
  3263   3263       char *zCmd;
................................................................................
  3896   3896   /*
  3897   3897   ** Show available command line options
  3898   3898   */
  3899   3899   static const char zOptions[] = 
  3900   3900     "   -ascii               set output mode to 'ascii'\n"
  3901   3901     "   -bail                stop after hitting an error\n"
  3902   3902     "   -batch               force batch I/O\n"
  3903         -  "   -colseparator SEP    same as -separator with one argument\n"
         3903  +  "   -colseparator SEP    same as -separator\n"
  3904   3904     "   -column              set output mode to 'column'\n"
  3905   3905     "   -cmd COMMAND         run \"COMMAND\" before reading stdin\n"
  3906   3906     "   -csv                 set output mode to 'csv'\n"
  3907   3907     "   -echo                print commands before execution\n"
  3908   3908     "   -init FILENAME       read/process named file\n"
  3909   3909     "   -[no]header          turn headers on or off\n"
  3910   3910   #if defined(SQLITE_ENABLE_MEMSYS3) || defined(SQLITE_ENABLE_MEMSYS5)