Rev 41 | Rev 89 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 41 | Rev 88 | ||
---|---|---|---|
Line 1754... | Line 1754... | ||
1754 | u8 *pbuff; |
1754 | u8 *pbuff; |
1755 | s16 c = 0; |
1755 | s16 c = 0; |
Line 1756... | Line 1756... | ||
1756 | 1756 | ||
1757 | if((!Partition.IsValid) || (file == NULL) || (string == NULL) || (length = 0)) return (0); |
1757 | if((!Partition.IsValid) || (file == NULL) || (string == NULL) || (length = 0)) return (0); |
1758 | pbuff = string; |
1758 | pbuff = string; |
1759 | while(length > 1) // read the count-1 characters from the file to the string. |
1759 | while(length > 1) // read the length-1 characters from the file to the string. |
1760 | { |
1760 | { |
1761 | c = fgetc_(file); // read a character from the opened file. |
1761 | c = fgetc_(file); // read a character from the opened file. |
1762 | switch(c) |
1762 | switch(c) |
1763 | { |
1763 | { |
Line 1769... | Line 1769... | ||
1769 | case EOF: |
1769 | case EOF: |
1770 | c = 0; // set string terminator |
1770 | c = 0; // set string terminator |
1771 | length = 1; // stop loop |
1771 | length = 1; // stop loop |
1772 | break; |
1772 | break; |
1773 | } |
1773 | } |
1774 | *pbuff = (u8)c; // copy byte to string |
1774 | *pbuff = (s8)c; // copy byte to string |
1775 | length--; |
1775 | length--; |
1776 | pbuff++; |
1776 | pbuff++; |
1777 | } |
1777 | } |
1778 | return(string); |
1778 | return(string); |
1779 | } |
1779 | } |