Help me find the error

//https://leetcode.com/problems/plus-one/
/**

  • Note: The returned array must be malloced, assume caller calls free().
    /
    int
    plusOne(int* digits, int digitsSize, int* returnSize){
    int*arr=malloc((digitsSize+1)*sizeof(int));
    int k=digitsSize,c=1;
    for(int i=digitsSize-1;i>=0;i–){
    if(digits[i]+c>=10){
    c=1;
    arr[k–]=0;
    }
    else{
    arr[k–]=digits[i]+c;
    c=0;
    }}
    if(arr[1]==0){
    arr[0]=1;
    return arr;
    }
    return arr+1;
    }

Check the following update to your code.

Accepted