Statement is unreachable in ff.cpp

24 Mar 2016

ff.cpp

w = (w << 8) + b; /* Create a DBC */

31 Mar 2016

You need to show this in context - where is the rest of the code?

-Mike

23 Mar 2017
  1. if !_LFN_UNICODE

w &= 0xFF;

if (IsDBCS1(w)) { /* Check if it is a DBC 1st byte (always false on SBCS cfg) */

b = (BYTE)p[si++]; /* Get 2nd byte */

if (!IsDBCS2(b))

return FR_INVALID_NAME; /* Reject invalid sequence */

w = (w << 8) + b; /* Create a DBC */

}

w = ff_convert(w, 1); /* Convert ANSI/OEM to Unicode */

if (!w) return FR_INVALID_NAME; /* Reject invalid code */

  1. endif

if (w < 0x80 && chk_chr("\"*:<>\?|\x7F", w)) /* Reject illegal chars for LFN */

return FR_INVALID_NAME;

lfn[di++] = w; /* Store the Unicode char */

}

  • path = &p[si]; /* Return pointer to the next segment */

cf = (w < ' ') ? NS_LAST : 0; /* Set last segment flag if end of path */