mirror of
https://github.com/rocky-linux/peridot.git
synced 2024-12-30 14:00:57 +00:00
10 lines
250 B
Go
10 lines
250 B
Go
package internal
|
|
|
|
// CheckRequestedWidth checks that requested width doesn't overflow
|
|
// available width
|
|
func CheckRequestedWidth(requested, available int) int {
|
|
if requested < 1 || requested >= available {
|
|
return available
|
|
}
|
|
return requested
|
|
}
|