strlen retruns the count with the terminating null byte but strncpy expects length with it. Account for that.