Fix some warnings
This commit is contained in:
2023-11-12 17:06:56 +01:00
parent 64182cd66b
commit 04f9dd3d2c

View File

@@ -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 dest_len = strlen(dest);
int src_len = strlen(src);
size_t dest_len = strlen(dest);
size_t src_len = strlen(src);
if (dest_len + src_len > dest_size) {
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 dest_len = strlen(dest);
size_t dest_len = strlen(dest);
if (dest_len + 1 > dest_size) {
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
* @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);
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)
{
int len = 0;
size_t len = 0;
// Add len of the virt files to the size
for (int i = 0; i < 2; i++)
{