mirror of
https://github.com/containers/skopeo.git
synced 2025-09-21 01:49:50 +00:00
... to work around some of the "unexpected EOF" failures. Signed-off-by: Miloslav Trmač <mitr@redhat.com>
11 lines
250 B
Go
11 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
|
|
}
|