summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 6e81a1b)
raw | patch | inline | side by side (parent: 6e81a1b)
author | Max Kellermann <max@duempel.org> | |
Mon, 15 Sep 2008 11:27:30 +0000 (13:27 +0200) | ||
committer | Max Kellermann <max@duempel.org> | |
Mon, 15 Sep 2008 11:27:30 +0000 (13:27 +0200) |
18 files changed:
src/conf.c | patch | blob | history | |
src/list_window.c | patch | blob | history | |
src/list_window.h | patch | blob | history | |
src/mpdclient.c | patch | blob | history | |
src/options.c | patch | blob | history | |
src/screen.c | patch | blob | history | |
src/screen_browse.h | patch | blob | history | |
src/screen_file.c | patch | blob | history | |
src/screen_help.c | patch | blob | history | |
src/screen_keydef.c | patch | blob | history | |
src/screen_lyrics.c | patch | blob | history | |
src/screen_play.c | patch | blob | history | |
src/screen_search.c | patch | blob | history | |
src/src_lyrics.c | patch | blob | history | |
src/src_lyrics.h | patch | blob | history | |
src/support.c | patch | blob | history | |
src/support.h | patch | blob | history | |
src/wreadln.c | patch | blob | history |
diff --git a/src/conf.c b/src/conf.c
index 5792dd22fd6f76e5070735cb17df8977545d0fb2..b49eeb2440ad4e920660252f7f63ff0d017470c4 100644 (file)
--- a/src/conf.c
+++ b/src/conf.c
static int
parse_key_value(char *str, size_t len, char **end)
{
- int i, value;
+ size_t i;
+ int value;
key_parser_state_t state;
i=0;
{
char buf[MAX_LINE_LENGTH];
char *p, *end;
- size_t len = strlen(str);
- int i,j,key;
+ size_t len = strlen(str), i;
+ int j,key;
int keys[MAX_COMMAND_KEYS];
command_t cmd;
{
char buf[MAX_LINE_LENGTH];
char *p, *end, *name;
- size_t len = strlen(str);
- int i,j,value;
+ size_t len = strlen(str), i;
+ int j,value;
short color, rgb[3];
/* get the command name */
diff --git a/src/list_window.c b/src/list_window.c
index 859652c1dcc8410d111c38ff680f7b532a883c30..af8abc9d4c07874b10077448618d05ac63401ae2 100644 (file)
--- a/src/list_window.c
+++ b/src/list_window.c
extern void screen_bell(void);
list_window_t *
-list_window_init(WINDOW *w, int width, int height)
+list_window_init(WINDOW *w, unsigned width, unsigned height)
{
list_window_t *lw;
}
void
-list_window_check_selected(list_window_t *lw, int length)
+list_window_check_selected(list_window_t *lw, unsigned length)
{
- while (lw->start && lw->start + lw->rows > length)
+ while (lw->start > 0 && lw->start + lw->rows > length)
lw->start--;
- if (lw->selected < 0)
- lw->selected = 0;
-
while (lw->selected < lw->start)
lw->selected++;
}
void
-list_window_set_selected(list_window_t *lw, int n)
+list_window_set_selected(list_window_t *lw, unsigned n)
{
lw->selected = n;
}
void
-list_window_next(list_window_t *lw, int length)
+list_window_next(list_window_t *lw, unsigned length)
{
- if (lw->selected < length - 1)
+ if (lw->selected + 1 < length)
lw->selected++;
else if (options.list_wrap)
lw->selected = 0;
}
void
-list_window_previous(list_window_t *lw, int length)
+list_window_previous(list_window_t *lw, unsigned length)
{
if (lw->selected > 0)
lw->selected--;
}
void
-list_window_last(list_window_t *lw, int length)
+list_window_last(list_window_t *lw, unsigned length)
{
lw->xoffset = 0;
- lw->selected = length - 1;
+ if (length > 0)
+ lw->selected = length - 1;
+ else
+ lw->selected = 0;
}
void
-list_window_next_page(list_window_t *lw, int length)
+list_window_next_page(list_window_t *lw, unsigned length)
{
- int step = lw->rows - 1;
- if (step <= 0)
+ if (lw->rows < 2)
return;
- if (lw->selected + step < length - 1)
- lw->selected += step;
+ if (lw->selected + lw->rows < length)
+ lw->selected += lw->rows - 1;
else
return list_window_last(lw, length);
}
void
list_window_previous_page(list_window_t *lw)
{
- int step = lw->rows - 1;
- if (step <= 0)
+ if (lw->rows < 2)
return;
- if (lw->selected-step > 0)
- lw->selected -= step;
+ if (lw->selected > lw->rows - 1)
+ lw->selected -= lw->rows - 1;
else
list_window_first(lw);
}
list_window_callback_fn_t callback,
void *callback_data)
{
- int i;
+ unsigned i;
int fill = options.wide_cursor;
int show_cursor = !(lw->flags & LW_HIDE_CURSOR);
int wrap)
{
int h;
- int i = lw->selected + 1;
+ unsigned i = lw->selected + 1;
const char *label;
while (wrap || i == lw->selected + 1) {
void *callback_data,
const char *str,
int wrap,
- int rows)
+ unsigned rows)
{
int h;
- int i = lw->selected-1;
+ int i = lw->selected - 1;
const char *label;
if (rows == 0)
return 1;
- while (wrap || i == lw->selected - 1) {
+ while (wrap || i == (int)lw->selected - 1) {
while (i >= 0 && (label = callback(i,&h,callback_data))) {
if( str && label && strcasestr(label, str) ) {
lw->selected = i;
return 0;
}
- if (wrap && i == lw->selected)
+ if (wrap && i == (int)lw->selected)
return 1;
i--;
}
/* perform basic list window commands (movement) */
int
-list_window_cmd(list_window_t *lw, int rows, command_t cmd)
+list_window_cmd(list_window_t *lw, unsigned rows, command_t cmd)
{
switch (cmd) {
case CMD_LIST_PREVIOUS:
diff --git a/src/list_window.h b/src/list_window.h
index ad66760bb9792bda3d106fd8383af9aaeddb63f5..2fadeebd123510c0450eaf374270aafc5b18ebe1 100644 (file)
--- a/src/list_window.h
+++ b/src/list_window.h
#define LW_HIDE_CURSOR 0x01
-typedef const char *(*list_window_callback_fn_t)(int index,
+typedef const char *(*list_window_callback_fn_t)(unsigned index,
int *highlight,
void *data);
typedef struct {
WINDOW *w;
- int rows, cols;
+ unsigned rows, cols;
- int start;
- int selected;
- int xoffset;
+ unsigned start;
+ unsigned selected;
+ unsigned xoffset;
int clear;
int repaint;
int flags;
/* create a new list window */
-list_window_t *list_window_init(WINDOW *w, int width, int height);
+list_window_t *list_window_init(WINDOW *w, unsigned width, unsigned height);
/* destroy a list window (returns NULL) */
list_window_t *list_window_free(list_window_t *lw);
void *callback_data);
/* perform basic list window commands (movement) */
-int list_window_cmd(list_window_t *lw, int rows, command_t cmd);
+int list_window_cmd(list_window_t *lw, unsigned rows, command_t cmd);
/* select functions */
-void list_window_set_selected(list_window_t *lw, int n);
-void list_window_previous(list_window_t *lw, int length);
-void list_window_next(list_window_t *lw, int length);
+void list_window_set_selected(list_window_t *lw, unsigned n);
+void list_window_previous(list_window_t *lw, unsigned length);
+void list_window_next(list_window_t *lw, unsigned length);
void list_window_first(list_window_t *lw);
-void list_window_last(list_window_t *lw, int length);
+void list_window_last(list_window_t *lw, unsigned length);
void list_window_previous_page(list_window_t *lw);
-void list_window_next_page(list_window_t *lw, int length);
-void list_window_check_selected(list_window_t *lw, int length);
+void list_window_next_page(list_window_t *lw, unsigned length);
+void list_window_check_selected(list_window_t *lw, unsigned length);
/* find a string in a list window */
int list_window_find(list_window_t *lw,
void *callback_data,
const char *str,
int wrap,
- int rows);
+ unsigned rows);
/* list window states */
list_window_state_t *list_window_init_state(void);
diff --git a/src/mpdclient.c b/src/mpdclient.c
index 0533cad95998684ee2d71edeff1e4802b39ff4f2..57b470681a82832af39143a22c8c8060988202bd 100644 (file)
--- a/src/mpdclient.c
+++ b/src/mpdclient.c
mpd_Song *song1, *song2;
if (old_index == new_index || new_index < 0 ||
- new_index >= c->playlist.length)
+ (guint)new_index >= c->playlist.length)
return -1;
song1 = playlist_get_song(c, old_index);
while ((entity = mpd_getNextInfoEntity(c->connection)) != NULL) {
mpd_Song *song = entity->info.song;
- if (song->pos < c->playlist.length) {
+ if (song->pos >= 0 && (guint)song->pos < c->playlist.length) {
GList *item = g_list_nth(c->playlist.list, song->pos);
/* update song */
}
/* remove trailing songs */
- while (c->status->playlistLength < c->playlist.length) {
+ while ((guint)c->status->playlistLength < c->playlist.length) {
GList *item = g_list_last(c->playlist.list);
/* Remove the last playlist entry */
diff --git a/src/options.c b/src/options.c
index 9b1aafe4f93c238326faafd043004bcbd542745c..7426a55caed471dcc240973488f07074992fb4ae 100644 (file)
--- a/src/options.c
+++ b/src/options.c
}
/* check for short options */
else if (len>=2 && g_str_has_prefix(arg, "-")) {
- int j;
+ size_t j;
for(j=1; j<len; j++) {
/* make shure we got an argument for the previous option */
diff --git a/src/screen.c b/src/screen.c
index d952a1fe41b60a637f0572e4aa45122d3fad78ea..3db9730e8e54a47b0f7e2f24672fe1da534a9554 100644 (file)
--- a/src/screen.c
+++ b/src/screen.c
paint_top_window(const char *header, mpdclient_t *c, int full_repaint)
{
static int prev_volume = -1;
- static int prev_header_len = -1;
+ static size_t prev_header_len = -1;
WINDOW *w = screen->top_window.w;
if (prev_header_len!=my_strlen(header)) {
colors_use(w, COLOR_STATUS);
/* scroll if the song name is to long */
- if (options.scroll && my_strlen(songname) > width) {
+ if (options.scroll && my_strlen(songname) > (size_t)width) {
static scroll_state_t st = { 0, 0 };
char *tmp = strscroll(songname, options.scroll_sep, width, &st);
}
/* if the even occured below the list window move down */
- if (*row >= lw->rows && lw) {
+ if ((unsigned)*row >= lw->rows && lw) {
if (event.bstate & BUTTON3_CLICKED)
list_window_last(lw, lw_length);
else
diff --git a/src/screen_browse.h b/src/screen_browse.h
index c58867500028bf9af71b9a49ae82d1edcb5935b6..0726d0b35b971b38dd2877c24501cab8e0ad7e21 100644 (file)
--- a/src/screen_browse.h
+++ b/src/screen_browse.h
int highlight);
-const char *browse_lw_callback(int index, int *highlight, void *filelist);
+const char *browse_lw_callback(unsigned index, int *highlight, void *filelist);
int browse_handle_select(screen_t *screen,
mpdclient_t *c,
diff --git a/src/screen_file.c b/src/screen_file.c
index ab2af071321c506c03d55ff164a58e2f7a421f25..c00ccba44bdd5f0b68d89e0737344831f515733a 100644 (file)
--- a/src/screen_file.c
+++ b/src/screen_file.c
/* list_window callback */
const char *
-browse_lw_callback(int idx, int *highlight, void *data)
+browse_lw_callback(unsigned idx, int *highlight, void *data)
{
static char buf[BUFSIZE];
mpdclient_filelist_t *fl = (mpdclient_filelist_t *) data;
mpdclient_filelist_t *fl)
{
int row;
- int prev_selected = local_lw->selected;
+ unsigned prev_selected = local_lw->selected;
unsigned long bstate;
int length;
diff --git a/src/screen_help.c b/src/screen_help.c
index 2b5dc1f162329ef7968e52f6dc242556afe28ed2..681bc6cfe5198d81ee65ee39630dfef28b3a54eb 100644 (file)
--- a/src/screen_help.c
+++ b/src/screen_help.c
static const char *
-list_callback(int idx, int *highlight, void *data)
+list_callback(unsigned idx, int *highlight, void *data)
{
static char buf[512];
}
*highlight = 0;
- if (idx < help_text_rows) {
+ if (idx < (unsigned)help_text_rows) {
*highlight = help_text[idx].highlight > 0;
if (help_text[idx].command == CMD_NONE) {
if (help_text[idx].text)
else if (help_text[idx].highlight == 2) {
int i;
- for (i = 3; i < COLS - 3 && i < sizeof(buf); i++)
+ for (i = 3; i < COLS - 3 && i < (int)sizeof(buf); i++)
buf[i] = '-';
buf[i] = '\0';
} else
lw->clear=1;
switch(cmd) {
case CMD_LIST_NEXT:
- if (lw->start + lw->rows < help_text_rows)
+ if (lw->start + lw->rows < (unsigned)help_text_rows)
lw->start++;
return 1;
case CMD_LIST_PREVIOUS:
lw->start = 0;
return 1;
case CMD_LIST_LAST:
- lw->start = help_text_rows - lw->rows;
- if (lw->start < 0)
+ if ((unsigned)help_text_rows > lw->rows)
+ lw->start = help_text_rows - lw->rows;
+ else
lw->start = 0;
return 1;
case CMD_LIST_NEXT_PAGE:
lw->start = lw->start + lw->rows;
- if (lw->start + lw->rows >= help_text_rows)
- lw->start = help_text_rows - lw->rows;
- if (lw->start < 0)
- lw->start = 0;
+ if (lw->start + lw->rows >= (unsigned)help_text_rows) {
+ if ((unsigned)help_text_rows > lw->rows)
+ lw->start = help_text_rows - lw->rows;
+ else
+ lw->start = 0;
+ }
return 1;
case CMD_LIST_PREVIOUS_PAGE:
- lw->start = lw->start - lw->rows;
- if (lw->start < 0)
+ if (lw->start > lw->rows)
+ lw->start -= lw->rows;
+ else
lw->start = 0;
return 1;
default:
lw, help_text_rows,
cmd, list_callback, NULL)) {
/* center the row */
- lw->start = lw->selected - (lw->rows / 2);
- if (lw->start + lw->rows > help_text_rows)
- lw->start = help_text_rows - lw->rows;
- if (lw->start < 0)
+ if (lw->selected > lw->rows / 2)
+ lw->start = lw->selected - lw->rows / 2;
+ else
lw->start = 0;
+ if (lw->start + lw->rows > (unsigned)help_text_rows) {
+ if (lw->rows < (unsigned)help_text_rows)
+ lw->start = help_text_rows - lw->rows;
+ else
+ lw->start = 0;
+ }
return 1;
}
diff --git a/src/screen_keydef.c b/src/screen_keydef.c
index bc37f1af3edc2958452d73d8711cd5eb16c2b40a..54a234961b83ef9a683ea9e3f43b861d983ba099 100644 (file)
--- a/src/screen_keydef.c
+++ b/src/screen_keydef.c
#define STATIC_SUB_ITEMS 1
#define BUFSIZE 256
-#define LIST_ITEM_APPLY() (command_list_length)
+#define LIST_ITEM_APPLY() ((unsigned)command_list_length)
#define LIST_ITEM_SAVE() (LIST_ITEM_APPLY()+1)
#define LIST_LENGTH() (LIST_ITEM_SAVE()+1)
static list_window_t *lw = NULL;
-static int command_list_length = 0;
+static unsigned command_list_length = 0;
static command_definition_t *cmds = NULL;
static int subcmd = -1;
-static int subcmd_length = 0;
-static int subcmd_addpos = 0;
+static unsigned subcmd_length = 0;
+static unsigned subcmd_addpos = 0;
static int
keybindings_changed(void)
}
static const char *
-list_callback(int idx, int *highlight, void *data)
+list_callback(unsigned idx, int *highlight, void *data)
{
static char buf[BUFSIZE];
*highlight = 0;
if (subcmd < 0) {
- if (idx < command_list_length) {
+ if (idx < (unsigned)command_list_length) {
if (cmds[idx].flags & COMMAND_KEY_CONFLICT)
*highlight = 1;
return cmds[idx].name;
lw->clear = 1;
return 1;
case CMD_DELETE:
- if (subcmd >= 0 && lw->selected - STATIC_SUB_ITEMS >= 0)
+ if (subcmd >= 0 && lw->selected >= STATIC_SUB_ITEMS)
delete_key(subcmd, lw->selected - STATIC_SUB_ITEMS);
return 1;
break;
diff --git a/src/screen_lyrics.c b/src/screen_lyrics.c
index 2c770ff595cd874e541012625f9c2c67b6e6167b..fb45fd49da23c9945387b06f626ea8f29a45f0ff 100644 (file)
--- a/src/screen_lyrics.c
+++ b/src/screen_lyrics.c
char title[512];
static char path[1024];
FILE *lyr_file;
- int i;
+ unsigned i;
char line_buf[1024];
get_text_line(&lyr_text, 0, artist, 512);
}
static const char *
-list_callback(int idx, int *highlight, void *data)
+list_callback(unsigned idx, int *highlight, void *data)
{
static char buf[512];
g_string_append (msg, "Lyrics [");
- if (src_selection > src_lyr_stack->len - 1)
+ if (src_selection > (int)src_lyr_stack->len - 1)
g_string_append (msg, "No plugin available");
else {
src_lyr* selected = g_array_index (src_lyr_stack, src_lyr*, src_selection);
lw->start = 0;
return 1;
case CMD_LIST_LAST:
- lw->start = lyrics_text_rows-lw->rows;
- if( lw->start<0 )
+ if ((unsigned)lyrics_text_rows > lw->rows)
+ lw->start = lyrics_text_rows - lw->rows;
+ else
lw->start = 0;
return 1;
case CMD_LIST_NEXT_PAGE:
- lw->start = lw->start + lw->rows-1;
- if( lw->start+lw->rows >= lyr_text.lines->len+1 )
- lw->start = lyr_text.lines->len-lw->rows+1;
- if( lw->start<0 )
- lw->start = 0;
+ lw->start = lw->start + lw->rows - 1;
+ if (lw->start + lw->rows >= (unsigned)lyrics_text_rows + 1) {
+ if ((unsigned)lyrics_text_rows + 1 > lw->rows)
+ lw->start = lyrics_text_rows + 1 - lw->rows;
+ else
+ lw->start = 0;
+ }
return 1;
case CMD_LIST_PREVIOUS_PAGE:
- lw->start = lw->start - lw->rows;
- if( lw->start<0 )
+ if (lw->start > lw->rows)
+ lw->start -= lw->rows;
+ else
lw->start = 0;
return 1;
case CMD_SELECT:
return 1;
case CMD_SEARCH_MODE:
//while (0==0) fprintf (stderr, "%i", src_lyr_stack->len);
- if (src_selection == src_lyr_stack->len - 1)
+ if (src_selection == (int)src_lyr_stack->len - 1)
src_selection = -1;
src_selection++;
return 1;
cmd, list_callback, NULL)) {
/* center the row */
lw->start = lw->selected - (lw->rows / 2);
- if (lw->start + lw->rows > lyrics_text_rows)
- lw->start = lyrics_text_rows - lw->rows;
- if (lw->start < 0)
- lw->start = 0;
+ if (lw->start + lw->rows > (unsigned)lyrics_text_rows) {
+ if (lw->rows < (unsigned)lyrics_text_rows)
+ lw->start = lyrics_text_rows - lw->rows;
+ else
+ lw->start = 0;
+ }
return 1;
}
diff --git a/src/screen_play.c b/src/screen_play.c
index a1bb369e66cb93e5c3f59e7417126b2701fb6919..6b68568eefc00cb8f88cf654e4897112415d40c7 100644 (file)
--- a/src/screen_play.c
+++ b/src/screen_play.c
}
static const char *
-list_callback(int idx, int *highlight, void *data)
+list_callback(unsigned idx, int *highlight, void *data)
{
static char songname[MAX_SONG_LENGTH];
mpdclient_t *c = (mpdclient_t *) data;
static int
center_playing_item(screen_t *screen, mpdclient_t *c)
{
- int length = c->playlist.length;
- int offset = lw->selected - lw->start;
+ unsigned length = c->playlist.length;
+ unsigned offset = lw->selected - lw->start;
int idx;
if (!lw || !c->song || length<lw->rows ||
/* try to center the song that are playing */
idx = playlist_get_index(c, c->song);
D("Autocenter song id:%d pos:%d index:%d\n", c->song->id,c->song->pos,idx);
- lw->start = idx - (lw->rows / 2);
- if (lw->start + lw->rows > length)
- lw->start = length - lw->rows;
- if (lw->start < 0)
- lw->start = 0;
+ idx -= (lw->rows / 2);
+ if (idx + (int)lw->rows > (int)length)
+ idx = length - lw->rows;
+ if (idx < 0)
+ idx = 0;
+ lw->start = idx;
/* make sure the cursor is in the window */
lw->selected = lw->start+offset;
handle_mouse_event(screen_t *screen, mpdclient_t *c)
{
int row;
- int selected;
+ unsigned selected;
unsigned long bstate;
if (screen_get_mouse_event(c, lw, c->playlist.length, &bstate, &row))
diff --git a/src/screen_search.c b/src/screen_search.c
index dd2353c000f6fa4a8fdc00b2fc923f531fbc5f50..2161b7914935ec2784b8f8c308b4bb5b609a9fd4 100644 (file)
--- a/src/screen_search.c
+++ b/src/screen_search.c
/* search info */
static const char *
-lw_search_help_callback(int idx, int *highlight, void *data)
+lw_search_help_callback(unsigned idx, int *highlight, void *data)
{
- int text_rows;
+ unsigned text_rows;
static const char *text[] = {
"Quick - just enter a string and ncmpc will search according",
" to the current search mode (displayed above).",
diff --git a/src/src_lyrics.c b/src/src_lyrics.c
index 448c301ad562f1ae04d955c0008dbcf706e931ff..6ac6cc3c5a102b710848543b81640820d5d8ae61 100644 (file)
--- a/src/src_lyrics.c
+++ b/src/src_lyrics.c
#define PLUGIN_DIR_USER "/.ncmpc/plugins"
-int get_text_line(formed_text *text, int num, char *dest, int len)
+int get_text_line(formed_text *text, unsigned num, char *dest, size_t len)
{
int linelen;
diff --git a/src/src_lyrics.h b/src/src_lyrics.h
index 941c4b63ab8d9b7b15b5181eceafcbfca4c0fe98..b972e7af5f9a22180ea7da86626f45c2a6f70f15 100644 (file)
--- a/src/src_lyrics.h
+++ b/src/src_lyrics.h
GArray *src_lyr_stack;
-int get_text_line(formed_text *text, int num, char *dest, int len);
+int get_text_line(formed_text *text, unsigned num, char *dest, size_t len);
void src_lyr_stack_init(void);
int src_lyr_init(void);
diff --git a/src/support.c b/src/support.c
index 315c569f742424a721dfa6f7db0ac3fa1d458504..ae3381ef294e60f3996287c3d08e55ad18aa3cbb 100644 (file)
--- a/src/support.c
+++ b/src/support.c
} else {
buf = g_malloc(size);
g_strlcpy(buf, tmp+st->offset, size);
- if (strlen(buf) < width)
+ if (strlen(buf) < (size_t)width)
g_strlcat(buf, tmp, size);
}
if( time(NULL)-st->t >= 1 ) {
diff --git a/src/support.h b/src/support.h
index 8e868e7ff9170af9ab26686617be28710e85f866..b80b9c8a2600379e47df2072c9993998d8820699 100644 (file)
--- a/src/support.h
+++ b/src/support.h
char *strcasestr(const char *haystack, const char *needle);
typedef struct {
- int offset;
+ gsize offset;
GTime t; /* GTime is equivalent to time_t */
} scroll_state_t;
diff --git a/src/wreadln.c b/src/wreadln.c
index e6bc612378e4e73613d71a5ad1a5694c094cf8ed..ed8ad9a390230bd861ba8597296c7ba5bd83f557 100644 (file)
--- a/src/wreadln.c
+++ b/src/wreadln.c
gint x1,
gchar *line)
{
- if (*cursor < strlen(line) && *cursor < wrln_max_line_size - 1) {
+ if (*cursor < (int)strlen(line) &&
+ *cursor < (int)wrln_max_line_size - 1) {
(*cursor)++;
if (*cursor + x0 >= x1 && *start < *cursor - width + 1)
(*start)++;
break;
case KEY_DC: /* handle delete key. As above */
case KEY_CTRL_D:
- if (cursor <= my_strlen(line) - 1) {
+ if (cursor <= (gint)my_strlen(line) - 1) {
for (i = cursor; line[i] != 0; i++)
line[i] = line[i + 1];
}