diff options
author | Suren A. Chilingaryan <csa@dside.dyndns.org> | 2011-07-06 03:10:08 +0200 |
---|---|---|
committer | Suren A. Chilingaryan <csa@dside.dyndns.org> | 2011-07-06 03:10:08 +0200 |
commit | e78aba2587be9e79e73ba3275b6c9b2de3c5c71a (patch) | |
tree | 9addb7cd84ed6f1e83ace469d985615f8c9f85d6 /cli.c | |
parent | 7af66933c5687fbba7a6ce3945475086bc67b97e (diff) | |
download | ipecamera-e78aba2587be9e79e73ba3275b6c9b2de3c5c71a.tar.gz ipecamera-e78aba2587be9e79e73ba3275b6c9b2de3c5c71a.tar.bz2 ipecamera-e78aba2587be9e79e73ba3275b6c9b2de3c5c71a.tar.xz ipecamera-e78aba2587be9e79e73ba3275b6c9b2de3c5c71a.zip |
Fix segmentation failure in DMA access mode
Diffstat (limited to 'cli.c')
-rw-r--r-- | cli.c | 6 |
1 files changed, 5 insertions, 1 deletions
@@ -1013,7 +1013,11 @@ int main(int argc, char **argv) { if (addr) { if ((!strncmp(addr, "dma", 3))&&((addr[3]==0)||isnumber(addr+3))) { if ((type)&&(amode != ACCESS_DMA)) Usage(argc, argv, "Conflicting access modes, the DMA read is requested, but access type is (%s)", type); - if ((addr[3] != 0)&&(strcmp(addr + 3, bank))) Usage(argc, argv, "Conflicting DMA channels are specified in read parameter (%s) and bank parameter (%s)", addr + 3, bank); + if (bank) { + if ((addr[3] != 0)&&(strcmp(addr + 3, bank))) Usage(argc, argv, "Conflicting DMA channels are specified in read parameter (%s) and bank parameter (%s)", addr + 3, bank); + } else { + if (addr[3] == 0) Usage(argc, argv, "The DMA channel is not specified"); + } dma = atoi(addr + 3); amode = ACCESS_DMA; } else if ((!strncmp(addr, "bar", 3))&&((addr[3]==0)||isnumber(addr+3))) { |