/* DAC960_ParseLogicalDrive parses spaces followed by a Logical Drive Number specification from a User Command string. It updates LogicalDriveNumber and returns true on success and false on failure.  */
static bool DAC960_ParseLogicalDrive(DAC960_Controller_T *Controller, char *UserCommandString, unsigned char *LogicalDriveNumber)
/* DAC960_ParseLogicalDrive parses spaces followed by a Logical Drive Number specification from a User Command string. It updates LogicalDriveNumber and returns true on success and false on failure.  */
static bool DAC960_ParseLogicalDrive(DAC960_Controller_T *Controller, char *UserCommandString, unsigned char *LogicalDriveNumber)
{
  char *NewUserCommandString = UserCommandString;
  unsigned long XLogicalDriveNumber;
  while (*UserCommandString == ' ') UserCommandString++;
  if (UserCommandString == NewUserCommandString)
    return false;
  XLogicalDriveNumber =
    simple_strtoul(UserCommandString, &NewUserCommandString, 10);
  if (NewUserCommandString == UserCommandString ||
      *NewUserCommandString != '\0' ||
      XLogicalDriveNumber > DAC960_MaxLogicalDrives - 1)
    return false;
  *LogicalDriveNumber = XLogicalDriveNumber;
  return true;
}