Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 1 addition & 3 deletions linenoise.c
Original file line number Diff line number Diff line change
Expand Up @@ -118,8 +118,6 @@
#include <stdint.h>
#include "linenoise.h"

#define LINENOISE_DEFAULT_HISTORY_MAX_LEN 100
#define LINENOISE_MAX_LINE 4096
static char *unsupported_term[] = {"dumb","cons25","emacs",NULL};
static linenoiseCompletionCallback *completionCallback = NULL;
static linenoiseHintsCallback *hintsCallback = NULL;
Expand Down Expand Up @@ -1551,7 +1549,7 @@ void linenoisePrintKeyCodes(void) {
if (memcmp(quit,"quit",sizeof(quit)) == 0) break;

printf("'%c' %02x (%d) (type quit to exit)\n",
isprint(c) ? c : '?', (int)c, (int)c);
isprint(c) ? c : '?', (unsigned int)c, (int)c);
printf("\r"); /* Go left edge manually, we are in raw mode. */
fflush(stdout);
}
Expand Down
14 changes: 11 additions & 3 deletions linenoise.h
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,16 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/

#ifndef __LINENOISE_H
#define __LINENOISE_H
#ifndef LINENOISE_H
#define LINENOISE_H

#ifndef LINENOISE_DEFAULT_HISTORY_MAX_LEN
#define LINENOISE_DEFAULT_HISTORY_MAX_LEN 100
#endif

#ifndef LINENOISE_MAX_LINE
#define LINENOISE_MAX_LINE 4096
#endif

#ifdef __cplusplus
extern "C" {
Expand Down Expand Up @@ -111,4 +119,4 @@ void linenoiseMaskModeDisable(void);
}
#endif

#endif /* __LINENOISE_H */
#endif /* LINENOISE_H */