usb-drive.c
static void incrementFileName( char *inFileName, char *outFileName ){
  int num, i;
  char number[4];

  /* Extract the number portion */
  for(i = 0; i < 4; i++){
    number[i] = inFileName[i + 3];
  }

  /* Convert to integer and increment */
  num = atoi(number);
  num++;

  if( num < 10000 ){
    /* Put together the output filename */
    memcpy( outFileName, "\0\0\0\0\0\0\0\0\0\0\0\0", 12 );
    strncpy( outFileName, "IMG", 3 );
    itoa( num, number );
    strncat( outFileName, "000", (4 - strlen(number)) );
    strncat( outFileName, number, strlen(number) );
    strncat( outFileName, ".JPG", 4);
  } else {
    strncpy( outFileName, "", 1 );
  }

}
/* incrementFileName()
 * Expects a filename in the form IMG####.JPG Increments the number portion
 *  and returns the result.
 *
 * Static function is only available to other functions within this file.
 */
incrementFileName()
Expects a filename in the form IMG####.JPG Increments the number portion
and returns the result.

Static function is only available to other functions within this file.
incrementFileName () Expects a filename in the form IMG#### . JPG Increments the number portion and returns the result . Static function is only available to other functions within this file .
static void incrementFileName( char *inFileName, char *outFileName ){
  int num, i;
  char number[4];
  for(i = 0; i < 4; i++){
    number[i] = inFileName[i + 3];
  }
  num = atoi(number);
  num++;
  if( num < 10000 ){
    memcpy( outFileName, "\0\0\0\0\0\0\0\0\0\0\0\0", 12 );
    strncpy( outFileName, "IMG", 3 );
    itoa( num, number );
    strncat( outFileName, "000", (4 - strlen(number)) );
    strncat( outFileName, number, strlen(number) );
    strncat( outFileName, ".JPG", 4);
  } else {
    strncpy( outFileName, "", 1 );
  }
}
static void incrementFileName ( char * inFileName , char * outFileName ) { int num , i ; char number [ 4 ] ; for ( i = 0 ; i < 4 ; i ++ ) { number [ i ] = inFileName [ i + 3 ] ; } num = atoi ( number ) ; num ++ ; if ( num < 10000 ) { memcpy ( outFileName , " \0 \0 \0 \0 \0 \0 \0 \0 \0 \0 \0 \0 " , 12 ) ; strncpy ( outFileName , " " , 3 ) ; itoa ( num , number ) ; strncat ( outFileName , " " , ( 4 - strlen ( number ) ) ) ; strncat ( outFileName , number , strlen ( number ) ) ; strncat ( outFileName , " " , 4 ) ; } else { strncpy ( outFileName , " " , 1 ) ; } }
incrementFileName()
 Expects a filename in the form IMG####.JPG Increments the number portion
  and returns the result.
incrementFileName () Expects a filename in the form IMG#### . JPG Increments the number portion and returns the result .
/* Extract the number portion */ /* Convert to integer and increment */ /* Put together the output filename */