diff options
author | dolorous <dolorous@c06c8d41-db1a-0410-9941-cceddc491573> | 2008-06-02 20:28:52 +0000 |
---|---|---|
committer | dolorous <dolorous@c06c8d41-db1a-0410-9941-cceddc491573> | 2008-06-02 20:28:52 +0000 |
commit | 0707acbff9bf2b25bcb0114bc43fbe91524bce54 (patch) | |
tree | feada0df7b846c89cc9a44480cf01b20f26964ea /crawl-ref/source/cio.cc | |
parent | 922f361918c7a0b9fa3cb2aebb505d2de1b35af0 (diff) | |
download | crawl-ref-0707acbff9bf2b25bcb0114bc43fbe91524bce54.tar.gz crawl-ref-0707acbff9bf2b25bcb0114bc43fbe91524bce54.zip |
Add more minor cosmetic fixes.
git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@5438 c06c8d41-db1a-0410-9941-cceddc491573
Diffstat (limited to 'crawl-ref/source/cio.cc')
-rw-r--r-- | crawl-ref/source/cio.cc | 24 |
1 files changed, 12 insertions, 12 deletions
diff --git a/crawl-ref/source/cio.cc b/crawl-ref/source/cio.cc index e50ba8ab0d..9e29f5c81f 100644 --- a/crawl-ref/source/cio.cc +++ b/crawl-ref/source/cio.cc @@ -138,15 +138,15 @@ void get_input_line( char *const buff, int len ) fgets( buff, len, stdin ); // much safer than gets() #endif - buff[ len - 1 ] = 0; // just in case + buff[ len - 1 ] = 0; // just in case // Removing white space from the end in order to get rid of any - // newlines or carriage returns that any of the above might have + // newlines or carriage returns that any of the above might have // left there (ie fgets especially). -- bwr - const int end = strlen( buff ); - int i; + const int end = strlen( buff ); + int i; - for (i = end - 1; i >= 0; i++) + for (i = end - 1; i >= 0; i++) { if (isspace( buff[i] )) buff[i] = 0; @@ -203,7 +203,7 @@ int wrapcprintf( int wrapcol, const char *s, ... ) if (x > wrapcol) // Somebody messed up! return 0; - + int avail = wrapcol - x + 1; int c = 0; if (len > avail) @@ -212,7 +212,7 @@ int wrapcprintf( int wrapcol, const char *s, ... ) run[avail] = 0; } cprintf("%s", run); - + if (len > avail) run[avail] = c; @@ -374,7 +374,7 @@ int line_reader::read_line(bool clear_previous) } else if (whattodo == -1) { - buffer[length] = 0; + buffer[length] = 0; return (ch); } } @@ -457,8 +457,8 @@ int line_reader::process_key(int ch) if (!history) break; - const std::string *text = - ch == CK_UP? history->prev() : history->next(); + const std::string *text = + ch == CK_UP ? history->prev() : history->next(); if (text) { @@ -470,7 +470,7 @@ int line_reader::process_key(int ch) buffer[length] = 0; cursorto(0); - int clear = length < olen? olen - length : 0; + int clear = length < olen ? olen - length : 0; wrapcprintf(wrapcol, "%s%*s", buffer, clear, ""); pos = length; @@ -487,7 +487,7 @@ int line_reader::process_key(int ch) case CONTROL('K'): { - // Kill to end of line + // Kill to end of line. int erase = length - pos; if (erase) { |