diff options
author | Adam Jackson <ajax@nwnk.net> | 2006-03-20 18:56:37 +0000 |
---|---|---|
committer | Adam Jackson <ajax@nwnk.net> | 2006-03-20 18:56:37 +0000 |
commit | 0197bfdddca98c72bca0eeee349b90027638fc32 (patch) | |
tree | cb39f821248f11642ed203e4e41a987fa3484212 | |
parent | 4f785cb5db6d95c9f539500e7b202a0f5addd19f (diff) |
Bug #5511, #5512: Print more sensible error messages when fed brokenXORG-7_0_99_901
command lines. (Bill Crawford)
-rw-r--r-- | ChangeLog | 6 | ||||
-rw-r--r-- | xrandr.c | 18 |
2 files changed, 22 insertions, 2 deletions
@@ -1,3 +1,9 @@ +2006-03-20 Adam Jackson <ajax@freedesktop.org> + + * xrandr.c: + Bug #5511, #5512: Print more sensible error messages when fed broken + command lines. (Bill Crawford) + 2005-12-20 Kevin E. Martin <kem-at-freedesktop-dot-org> * configure.ac: @@ -219,12 +219,15 @@ main (int argc, char **argv) if (sizes[size].width == width && sizes[size].height == height) break; } + if (size >= nsize) { + fprintf (stderr, + "Size %dx%d not found in available modes\n", width, height); + exit (1); + } } else if (size < 0) size = current_size; - if (size >= nsize) usage(); - if (rot < 0) { for (rot = 0; rot < 4; rot++) @@ -241,6 +244,17 @@ main (int argc, char **argv) else rate = 0; } + else + { + rates = XRRConfigRates (sc, size, &nrate); + for (i = 0; i < nrate; i++) + if (rate == rates[i]) + break; + if (i == nrate) { + fprintf (stderr, "Rate %d not available for this size\n", rate); + exit (1); + } + } if (version) { int major_version, minor_version; |