Codebase list golang-github-vbauerster-mpb / lintian-fixes/main internal / width.go
lintian-fixes/main

Tree @lintian-fixes/main (Download .tar.gz)

width.go @lintian-fixes/mainraw · history · blame

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
}