Unfortunately, these are the types of problems commonly found in old homes. My advice here is to lift or remove carpet to check for this type of damage if possible. If not found prior to ownership, the removal and replacement or repair will be at your own cost. If found to be termite damage, it will be covered by the insurance of the inspector.