this function suppose to move cusor to one space backward, but it gives me error. it compiles, but would not run...
definitions
Code:
typedef struct node{
char chdata;
struct node *link;
struct node *prev;
struct node *next;
} node;
typedef struct node *position;
typedef struct bufferType{
node *head;
node *cursor;
node *clipboard;
} bufferType;
typedef bufferType *bufferT;
backward function
Code:
void MoveCursorBackward(bufferT buffer)
{
position temp;
if(buffer -> head)
{
while(temp -> next != buffer->cursor->next)
{
temp = temp -> next ;
}
buffer->cursor = temp;
}
}