leni = sizeof matrix / sizeof matrix[0][0]; it doesn't calculates the number of rows. It calculates nothing in fact.
The best way is to provide leni and lenj explicitly to function as additional parameters, like void printMatrix(int **matrix*matrix, int leni, int lenj).
Also you should know that there is no way to determine the size of some random array because it is just a pointer without any meta-information.