TFTP
Fix some warnings
This commit is contained in:
@@ -17,8 +17,8 @@ static tftp_custom_file_t virt_file[] =
|
|||||||
};
|
};
|
||||||
|
|
||||||
int str_cat_str(char* dest, size_t dest_size, const char* src) {
|
int str_cat_str(char* dest, size_t dest_size, const char* src) {
|
||||||
int dest_len = strlen(dest);
|
size_t dest_len = strlen(dest);
|
||||||
int src_len = strlen(src);
|
size_t src_len = strlen(src);
|
||||||
if (dest_len + src_len > dest_size) {
|
if (dest_len + src_len > dest_size) {
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
@@ -28,7 +28,7 @@ int str_cat_str(char* dest, size_t dest_size, const char* src) {
|
|||||||
|
|
||||||
int str_cat(char* dest, size_t dest_size, char c)
|
int str_cat(char* dest, size_t dest_size, char c)
|
||||||
{
|
{
|
||||||
int dest_len = strlen(dest);
|
size_t dest_len = strlen(dest);
|
||||||
if (dest_len + 1 > dest_size) {
|
if (dest_len + 1 > dest_size) {
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
@@ -95,7 +95,7 @@ size_t tftp_custom_fread(void* buf, size_t bytes, tftp_custom_file_t* handle) {
|
|||||||
* @param write Flag indicating read (0) or write (!= 0) access
|
* @param write Flag indicating read (0) or write (!= 0) access
|
||||||
* @return void* File handle supplied to other functions
|
* @return void* File handle supplied to other functions
|
||||||
*/
|
*/
|
||||||
void* tftp_open(const char* fname, const char* mode, u8_t write) {
|
void* tftp_open(const char* fname, const char* mode, uint8_t write) {
|
||||||
LOG_INFO(TAG, "Opening %s", fname);
|
LOG_INFO(TAG, "Opening %s", fname);
|
||||||
|
|
||||||
if (strcmp(fname, virt_file[0].name) == 0 && write == TFTP_READ) {
|
if (strcmp(fname, virt_file[0].name) == 0 && write == TFTP_READ) {
|
||||||
@@ -180,7 +180,7 @@ int tftp_write(void* handle, struct pbuf* p) {
|
|||||||
*/
|
*/
|
||||||
void init_index(void)
|
void init_index(void)
|
||||||
{
|
{
|
||||||
int len = 0;
|
size_t len = 0;
|
||||||
// Add len of the virt files to the size
|
// Add len of the virt files to the size
|
||||||
for (int i = 0; i < 2; i++)
|
for (int i = 0; i < 2; i++)
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user