calculate file/folder name length the same way SharePoint online does
i believe SPO calculates folder/file names using a space = 1 character. onedrive for business sync app however calculates based on space = %20 = 3 characters. this results in valid files/folders from preventing the sync of the entire OD4B folder to a pc, even though there is nothing invalid.
additionally, if this isn't fixed, you should return a full list of the offending files and perhaps offer to convert the space characters to _ or something to automatically resolve the issue.