1. PHP / Говнокод #3296

    +189

    1. 1
    2. 2
    3. 3
    switch ($item) {
         case $item:        getitem($item);break;
      }

    Hast, 23 Мая 2010

    Комментарии (11)
  2. C++ / Говнокод #3295

    +153

    1. 01
    2. 02
    3. 03
    4. 04
    5. 05
    6. 06
    7. 07
    8. 08
    9. 09
    10. 10
    11. 11
    12. 12
    13. 13
    14. 14
    15. 15
    16. 16
    17. 17
    18. 18
    19. 19
    20. 20
    21. 21
    22. 22
    23. 23
    24. 24
    25. 25
    26. 26
    27. 27
    28. 28
    29. 29
    30. 30
    31. 31
    32. 32
    33. 33
    34. 34
    35. 35
    switch(num_q)
    			{
    				case 0: if(Terminated)MForm->term[num_q] = true;
    						else MForm->pausa[num_q] = true; break;
    				case 1:	if(Terminated)MForm->term[num_q] = true;
    						else MForm->pausa[num_q]= true ; break;
    				case 2: if(Terminated)MForm->term[num_q] = true;
    						else MForm->pausa[num_q] = true; break;
    				case 3: if(Terminated)MForm->term[num_q] = true;
    						else MForm->pausa[num_q]= true; break;
    				case 4: if(Terminated)MForm->term[num_q] = true;
    						else MForm->pausa[num_q]= true; break;
    				case 5: if(Terminated)MForm->term[num_q] = true;
    						else MForm->pausa[num_q]= true; break;
    				case 6: if(Terminated)MForm->term[num_q] = true;
    						else MForm->pausa[num_q]= true; break;
    				case 7: if(Terminated)MForm->term[num_q] = true;
    						else MForm->pausa[num_q]= true; break;
    				case 8: if(Terminated)MForm->term[num_q] = true;
    						else MForm->pausa[num_q]= true; break;
    				case 9: if(Terminated)MForm->term[num_q] = true;
    						else MForm->pausa[num_q] = true; break;
    				case 10: if(Terminated)MForm->term[num_q] = true;
    						else MForm->pausa[num_q] = true; break;
    				case 11: if(Terminated)MForm->term[num_q] = true;
    						else MForm->pausa[num_q] = true; break;
    				case 12: if(Terminated)MForm->term[num_q] = true;
    						else MForm->pausa[num_q] = true; break;
    				case 13: if(Terminated)MForm->term[num_q] = true;
    						else MForm->pausa[num_q] = true; break;
    				case 14: if(Terminated)MForm->term[num_q] = true;
    						else MForm->pausa[num_q]= true; break;
    				case 15: if(Terminated)MForm->term[num_q] = true;
    						else MForm->pausa[num_q] = true; break;
    			}

    ночью надо спать...

    o_jumi, 23 Мая 2010

    Комментарии (24)
  3. bash / Говнокод #3294

    −142

    1. 01
    2. 02
    3. 03
    4. 04
    5. 05
    6. 06
    7. 07
    8. 08
    9. 09
    10. 10
    11. 11
    12. 12
    13. 13
    14. 14
    15. 15
    16. 16
    17. 17
    18. 18
    19. 19
    20. 20
    21. 21
    22. 22
    23. 23
    24. 24
    25. 25
    26. 26
    27. 27
    28. 28
    29. 29
    30. 30
    31. 31
    32. 32
    33. 33
    34. 34
    35. 35
    36. 36
    37. 37
    38. 38
    39. 39
    40. 40
    41. 41
    42. 42
    43. 43
    44. 44
    45. 45
    46. 46
    47. 47
    48. 48
    49. 49
    50. 50
    51. 51
    52. 52
    53. 53
    54. 54
    55. 55
    56. 56
    57. 57
    58. 58
    59. 59
    60. 60
    61. 61
    62. 62
    63. 63
    64. 64
    65. 65
    66. 66
    67. 67
    68. 68
    69. 69
    70. 70
    71. 71
    72. 72
    #!/bin/bash
    #   
    #   program file name: urlmin.sh
    #   program version: 0.4
    
    _help()
    {
    
    prg=$(basename $0)
    cat << EOF
    
    options:
       -h      See this page
       -l      Viewed all names of minifer sites
       -s      
       	  lb.vg
       	  minify.me
       	  is.gd
       -r      Random mode of minifiers
       -u      url link
    examples:
       random mode     - minifiers: ${prg} -r -u 'http://wikimapia.org/#lat=36.7923994&lon=53.1100881&z=18&l=1&m=b'
       only 1 minifier - is.gd minifier: ${prg} -s is.gd -u 'http://wikimapia.org/#lat=36.7923994&lon=53.1100881&z=18&l=1&m=b'
       or lb.vg minifier: ${prg} -s lb.vg -u 'http://wikimapia.org/#lat=36.7923994&lon=53.1100881&z=18&l=1&m=b'
       and other
    
    EOF
    
    exit 0
    }
    
    [ ! -f "$(which curl)" ] && { echo "Установите утилиту curl" ; exit 1 ;}
    
    _user_agent="Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US; rv:1.9.2.4) Gecko/20100503 Firefox/3.6.4"
    _sets_minifiers=( "lb.vg" "is.gd" "minify.me" )
    
    _e()         { echo -e "${*}" ;}
    _get_page()  { curl -s -A "$USER_AGENT" ${1} | tr -d '\n' || { clear ; echo -e "${B_T}${RC}Error${CRS}! curl in function _get_page has exited abnormaly: ${1}" ; exit 1 ;} ;}
    _post_page() { curl -s -A "$USER_AGENT" -d "${2}" "${1}" | tr -d "\n" || { clear ; echo -e "${B_T}${RC}Error!${CRS} curl in function _post_page has exited abnormaly: ${1} -> ${2}" ; exit 1 ;} ;}
    _urlencode() { LANG=C awk 'BEGIN { EOL = "%0A" ; split ("1 2 3 4 5 6 7 8 9 A B C D E F", hextab, " ") ; hextab [0] = 0 ; for ( i=1; i<=255; ++i ) ord [ sprintf ("%c", i) "" ] = i + 0 } ; { encoded = "" ; for ( i=1; i<=length ($0); ++i ) { c = substr ($0, i, 1) ; if ( c ~ /[a-zA-Z0-9.-]/ ) { encoded = encoded c } else if ( c == " " ) { encoded = encoded "+" } else { lo = ord [c] % 16 ; hi = int (ord [c] / 16); encoded = encoded "%" hextab [hi] hextab [lo] } } ; printf ("%s", encoded EOL) } END { }' "$@" | sed 's|%0A||g' ;}
    _random()    { [ -n "${1}" ] && { while :; do zz=$(y=0;for ((x=${1};x>=y;y++)) ; do [ "$y" == "${RANDOM[@]:2:1}" ] && [ -n "$y" ] && { echo $y ; break ;} ; done ) ; [ -n "$zz" ] && { echo "$zz" ; break ;} ; done ;} ;}
    
    # sets
    while getopts "hu:s:rl" option ; do case $option in
    		h) _help                ;;
    		u) url_path="$OPTARG"   ;;
    		s) _set_min="$OPTARG"    ; set_min_num=$(j=0 ; for x in ${_sets_minifiers[*]} ; do [ "${x}" == "${_set_min}" ] && _e "${j}" ; ((j++)) ; done) ;;
    		r) mode_random="yes"     ; set_min_num="$(_random $((${#_sets_minifiers[*]}-1)) )" ;;
    		l) list_mins="yes"      ;;
    		v) set_verbose="-v"     ;;
    esac ; done
    
    case $set_min_num in
    0) 
       _url_enc=$(_e "${url_path}" | _urlencode)
       _url_host="${_sets_minifiers[$set_min_num]}"
       _obtained=$(_post_page "http://${_url_host}/default.asp" "Orig_URL=${_url_enc}&show_ve=1&Categ=Humor" | egrep -o "http://${_url_host}/[a-Z0-9]+'" | sort -u | sed "s|'||g;s|http://||g") ;;
    1)
       _url_enc=$(_e "${url_path}" | _urlencode)
       _url_host="${_sets_minifiers[$set_min_num]}"
       _obtained=$(_post_page "http://${_url_host}/create.php" "URL=${_url_enc}" | egrep -o "http://${_url_host}/[a-Z0-9]+\" target" | sed 's|\" target||g;s|http://||g') ;;
    2) 
       _url_enc=$(_e "${url_path}" | _urlencode)
       _url_host="${_sets_minifiers[$set_min_num]}"
       _obtained=$(_post_page "http://${_url_host}/create.php" "url=${_url_enc}" | egrep -o "http://${_url_host}/\?[a-Z0-9]+" | sed 's|http://||g') ;;
    esac
    
    [ -z "$1"           ] && _help
    [ -n "$set_min_num" ] && _e "Link: ${_obtained}"
    [ -n "$list_mins"   ] && _e "Minifiers:\n\n$(for i in ${_sets_minifiers[*]} ; do _e "  ${i}" ; done)\n"
    
    # eof urlmin.sh

    url minifier

    # typical define:
    -=>> ./urlmin.sh -s is.gd -u 'http://wikimapia.org/#lat=36.7923994&lon=53.1100881&z=18&l=1& m=b'
    Link: is.gd/ckjsg

    # random minifier:
    -=>> ./urlmin.sh -r -u 'http://wikimapia.org/#lat=36.7923994&lon=53.1100881&z=18&l=1& m=b'
    Link: minify.me/?qkvbp2

    pp--, 22 Мая 2010

    Комментарии (15)
  4. JavaScript / Говнокод #3293

    +160

    1. 001
    2. 002
    3. 003
    4. 004
    5. 005
    6. 006
    7. 007
    8. 008
    9. 009
    10. 010
    11. 011
    12. 012
    13. 013
    14. 014
    15. 015
    16. 016
    17. 017
    18. 018
    19. 019
    20. 020
    21. 021
    22. 022
    23. 023
    24. 024
    25. 025
    26. 026
    27. 027
    28. 028
    29. 029
    30. 030
    31. 031
    32. 032
    33. 033
    34. 034
    35. 035
    36. 036
    37. 037
    38. 038
    39. 039
    40. 040
    41. 041
    42. 042
    43. 043
    44. 044
    45. 045
    46. 046
    47. 047
    48. 048
    49. 049
    50. 050
    51. 051
    52. 052
    53. 053
    54. 054
    55. 055
    56. 056
    57. 057
    58. 058
    59. 059
    60. 060
    61. 061
    62. 062
    63. 063
    64. 064
    65. 065
    66. 066
    67. 067
    68. 068
    69. 069
    70. 070
    71. 071
    72. 072
    73. 073
    74. 074
    75. 075
    76. 076
    77. 077
    78. 078
    79. 079
    80. 080
    81. 081
    82. 082
    83. 083
    84. 084
    85. 085
    86. 086
    87. 087
    88. 088
    89. 089
    90. 090
    91. 091
    92. 092
    93. 093
    94. 094
    95. 095
    96. 096
    97. 097
    98. 098
    99. 099
    100. 100
    //browser detect for NN 4.xx and IE 4.xx and below, if so redirect to upgrade page.
    	var agt=navigator.userAgent.toLowerCase();
        var appVer = navigator.appVersion.toLowerCase();
        var is_minor = parseFloat(appVer);
        var is_major = parseInt(is_minor);
    	// If Mac platform, also use the Macintosh style sheet.
    	if (navigator.platform.indexOf('Mac') != -1) {
    		document.write('<link rel="stylesheet" href="/Shared/css/screen_mac.css?v=5.0">');
    		document.write('<link rel="stylesheet" href="/Local/'+locale+'/css/local_mac.css?v=5.0">');
    	}	
    	
    	function isIEUnsupported() 
    	{
    		var iePos  = appVer.indexOf('msie');
    		if (iePos !=-1) {
    		   is_minor = parseFloat(appVer.substring(iePos+5,appVer.indexOf(';',iePos)));
    		   is_major = parseInt(is_minor);
    		}
    		if ((iePos!=-1) && is_major<6) {
    			if (isRetail.toLowerCase() == "true") {return false} 
    			else {return true}
    		}	
    		else {return false}
    	}
    	
    	function isSafariUnsupported() 
    	{
    		if((agt.indexOf('safari') > 0) && agt.indexOf('mac') > 0 )
    		{
    			is_minor = parseFloat(agt.substring(agt.indexOf('safari')+7,agt.indexOf('safari')+12));
    			is_major = parseInt(is_minor);
    			if (is_major < 412) {return true}
    			else {return false}
    		}
    	}
    	
    	function isSafari3Plus()
    	{
    		if(agt.indexOf('safari') > 0)
    		{
    			is_minor = parseFloat(agt.substring(agt.indexOf('safari')+7,agt.indexOf('safari')+12));
    			is_major = parseInt(is_minor);
    			if (is_major >= 500) {return true}
    			else {return false}
    		}
    		return false;
    	}
    
    	var browserName=navigator.appName;
    	var browserVer=parseInt(navigator.appVersion);
    	var isMac = (navigator.appVersion.indexOf("Mac") != -1);
    	//Do Object detection
    	if (document.getElementById) {
    		if ((browserName=="Netscape" && browserVer<5) || isIEUnsupported() || isSafariUnsupported() || (browserName=="Microsoft Internet Explorer" && isMac)) 
    			{
    				document.location.href = "/Common/errors/upgrade.aspx";
    			}
    	}
    	else {document.location.href = "/Common/errors/upgrade.aspx";}
    
    	
    	function shouldPriceBeVisible()
    	{
    		if ((locale.toLowerCase() == "intl" && isRetail.toLowerCase() == "false") || (locale.toLowerCase() == "zh-cn"))
    		{
    			return false;
    		}
    		return true;
    	}
    	
        function Redirect(url)
        {
    	    window.location = url;
        }
    	
    	// ND: Added so that tIFR could access user agent through ExternalInterface
    	function getUserAgent()
    	{
    		return navigator.userAgent.toLowerCase();
    	}
    	
    	// ND: Added so that tIFR could access browser detection through ExternalInterface
    	function isBrowserIE()
    	{
    		var iePos = appVer.indexOf('msie');
    		if (iePos !=-1) 
    		{
    		   is_minor = parseFloat(appVer.substring(iePos+5,appVer.indexOf(';',iePos)));
    		   is_major = parseInt(is_minor);
    		}
    		
    		if ((iePos!=-1) && is_major >= 4) 
    		{
    			return true;
    		}	
    		else 
    		{
    			return false;
    		}
    	}

    Прошу прощения за многабукаф. Найдено на просторах www.tiffany.com. Помимо этого, там ещё много отжигов - например, hidden-поля в формах, содержащие несколько десятков килобайт Base64-кодированных данных. Что-то похожее как-то раз уже проскальзывало; как и в том случае, сайт сделан на ASP.NET.

    telnet, 22 Мая 2010

    Комментарии (4)
  5. PHP / Говнокод #3292

    +165

    1. 1
    2. 2
    3. 3
    4. 4
    5. 5
    $image = $_FILES['image']['tmp_name'];    
        if( !empty($image) )
        {
           @$src = imagecreatefromjpeg($image);
    if($src==false){exit ('Это не картинка'); }

    Этот кусочек кода был спором 7 человек;)
    Это говнокод?

    FallenServer, 22 Мая 2010

    Комментарии (40)
  6. JavaScript / Говнокод #3291

    +162

    1. 01
    2. 02
    3. 03
    4. 04
    5. 05
    6. 06
    7. 07
    8. 08
    9. 09
    10. 10
    11. 11
    12. 12
    13. 13
    14. 14
    15. 15
    16. 16
    17. 17
    18. 18
    function get_cookie_352(name) 
    {
       var arg = name + "=";
       var alen = arg.length;
       var clen = document.cookie.length;
       var i = 0;
       while (i < clen) {
          var j = i + alen;
          if (document.cookie.substring(i, j) == arg) {
             return true;
          }
          i = document.cookie.indexOf(" ", i) + 1;
          if (i == 0) {
             break;
          }
       }
       return null;
    }

    Типа поиск подстроки в строке. Причем про indexOf точно знают.

    afj, 22 Мая 2010

    Комментарии (3)
  7. C++ / Говнокод #3290

    +155

    1. 01
    2. 02
    3. 03
    4. 04
    5. 05
    6. 06
    7. 07
    8. 08
    9. 09
    10. 10
    11. 11
    12. 12
    13. 13
    14. 14
    15. 15
    16. 16
    17. 17
    18. 18
    19. 19
    20. 20
    21. 21
    22. 22
    23. 23
    24. 24
    25. 25
    26. 26
    27. 27
    28. 28
    29. 29
    30. 30
    31. 31
    32. 32
    33. 33
    34. 34
    35. 35
    36. 36
    37. 37
    38. 38
    39. 39
    40. 40
    41. 41
    42. 42
    43. 43
    44. 44
    45. 45
    46. 46
    47. 47
    48. 48
    49. 49
    50. 50
    51. 51
    52. 52
    53. 53
    54. 54
    55. 55
    56. 56
    57. 57
    58. 58
    59. 59
    60. 60
    61. 61
    62. 62
    63. 63
    64. 64
    65. 65
    66. 66
    67. 67
    68. 68
    char Sort(char Type, int l, int r)
    {
      int i = l, j = r;
      char x[31];
      void *y = 0;
      setmem(x, 31, 0);
      strcpy(x, ((TData*)(DataLists[CurrentList][(l+r)/2]))->Data[CurrentCol-1]);
      do
      {
        if (Type==UP)
        {
          switch(CurrentCol)
          {
    	case 1: case 2:
    	  while (strcmp(((TData*)(DataLists[CurrentList][i]))->Data[CurrentCol-1], x) < 0)
    	    ++i;
    	  while (strcmp(((TData*)(DataLists[CurrentList][j]))->Data[CurrentCol-1], x) > 0)
    	    --j;
    	  break;
    	default:
    	  while (atoi(((TData*)(DataLists[CurrentList][i]))->Data[CurrentCol-1])<atoi(x))
    	  ++i;
    	  while (atoi(((TData*)(DataLists[CurrentList][j]))->Data[CurrentCol-1])>atoi(x))
    	  --j;
          }
        }
        else
        {
          switch(CurrentCol)
          {
    	case 1: case 2:
    	  while (strcmp(((TData*)(DataLists[CurrentList][i]))->Data[CurrentCol-1], x) > 0)
    	    ++i;
    	  while (strcmp(((TData*)(DataLists[CurrentList][j]))->Data[CurrentCol-1], x) < 0)
    	    --j;
    	  break;
    	default:
    	  while (atoi(((TData*)(DataLists[CurrentList][i]))->Data[CurrentCol-1])>atoi(x))
    	    ++i;
    	  while (atoi(((TData*)(DataLists[CurrentList][j]))->Data[CurrentCol-1])<atoi(x))
    	    --j;
          }//switch
        }//if
        if (i<=j)
        {
          y = DataLists[CurrentList][i];
          *(DataLists[CurrentList].GetPointerToData(i)) = DataLists[CurrentList][j];
          *(DataLists[CurrentList].GetPointerToData(j)) = y;
          ++i, --j;
        }
      }
      while (i<=j);
        if (l<j)
        {
          if (Type==UP)
    	Sort(UP, l, j);
          else
    	Sort(DOWN, l, j);
        }
      if (i<r)
      {
        if (Type==UP)
          Sort(UP, i, r);
        else
          Sort(DOWN, i, r);
      }
    return 1;
    }

    По-моему, это должна была быть сортировка Хоара, а получилось говно. Самое странное - это то, что оно работает...

    Max ID, 21 Мая 2010

    Комментарии (9)
  8. C++ / Говнокод #3289

    +144

    1. 1
    2. 2
    3. 3
    4. 4
    5. 5
    6. 6
    void main(void)
    {
      int s, e, x, y, n, i, g, e, r, s;
      // действия с вышеобъявленными переменными
      return;
    }

    Max ID, 21 Мая 2010

    Комментарии (51)
  9. PHP / Говнокод #3288

    +173

    1. 1
    2. 2
    3. 3
    4. 4
    5. 5
    6. 6
    7. 7
    # текст сообщений об ошибке
    $errDescr[1] = NETCAT_MODERATION_MSG_ONE;
    $errDescr[2] = NETCAT_MODERATION_MSG_TWO;
    $errDescr[6] = NETCAT_MODERATION_MSG_SIX;
    $errDescr[7] = NETCAT_MODERATION_MSG_SEVEN;
    $errDescr[8] = NETCAT_MODERATION_MSG_EIGHT;
    $errDescr[21] = NETCAT_MODERATION_MSG_TWENTYONE;

    Чьорт, я обожаю этих ребят. Они мои герои.

    telnet, 21 Мая 2010

    Комментарии (17)
  10. Си / Говнокод #3287

    +135

    1. 01
    2. 02
    3. 03
    4. 04
    5. 05
    6. 06
    7. 07
    8. 08
    9. 09
    10. 10
    11. 11
    12. 12
    13. 13
    14. 14
    15. 15
    16. 16
    17. 17
    18. 18
    19. 19
    20. 20
    21. 21
    22. 22
    23. 23
    24. 24
    25. 25
    26. 26
    27. 27
    28. 28
    29. 29
    30. 30
    31. 31
    32. 32
    33. 33
    34. 34
    35. 35
    36. 36
    37. 37
    38. 38
    39. 39
    40. 40
    41. 41
    42. 42
    43. 43
    44. 44
    45. 45
    46. 46
    47. 47
    48. 48
    49. 49
    50. 50
    51. 51
    52. 52
    53. 53
    54. 54
    55. 55
    56. 56
    57. 57
    58. 58
    59. 59
    60. 60
    61. 61
    62. 62
    63. 63
    64. 64
    65. 65
    66. 66
    67. 67
    68. 68
    69. 69
    70. 70
    71. 71
    72. 72
    73. 73
    74. 74
    75. 75
    76. 76
    77. 77
    78. 78
    79. 79
    80. 80
    81. 81
    82. 82
    83. 83
    84. 84
    85. 85
    86. 86
    87. 87
    88. 88
    89. 89
    90. 90
    91. 91
    92. 92
    93. 93
    94. 94
    95. 95
    96. 96
    int param_check(char *func, ...) {
      int fail;
      va_list al;
    
      if (!func) {
        return(1);
      }
      
      va_start(al, func);
      fail=0;
      if (!strcmp(func, "vnetGenerateDHCP") || !strcmp(func, "vnetKickDHCP")) {
        vnetConfig *a = va_arg(al, vnetConfig *);
        if (!a) {
          fail=1;
        }
      } else if (!strcmp(func, "vnetAddPublicIP") || !strcmp(func, "vnetAddDev")) {
        vnetConfig *a = va_arg(al, vnetConfig *);
        char *b = va_arg(al, char *);
        if (!a || !b) {
          fail=1;
        }
      } else if (!strcmp(func, "vnetAddHost")) {
        vnetConfig *a = va_arg(al, vnetConfig *);
        char *b = va_arg(al, char *);
        char *c = va_arg(al, char *);
        int d = va_arg(al, int);
        if (!a || !b || (d < 0) || (d > NUMBER_OF_VLANS-1)) {
          fail=1;
        }
      } else if (!strcmp(func, "vnetGetNextHost")) {
        vnetConfig *a = va_arg(al, vnetConfig *);
        char *b = va_arg(al, char *);
        char *c = va_arg(al, char *);
        int d = va_arg(al, int);
        if (!a || !b || !c || d < 0 || d > NUMBER_OF_VLANS-1) {
          fail=1;
        }
      } else if (!strcmp(func, "vnetDelHost") || !strcmp(func, "vnetEnableHost") || !strcmp(func, "vnetDisableHost")) {
        vnetConfig *a = va_arg(al, vnetConfig *);
        char *b = va_arg(al, char *);
        char *c = va_arg(al, char *);
        int d = va_arg(al, int);
        if (!a || (!b && !c) || d < 0 || d > NUMBER_OF_VLANS-1) {
          fail=1;
        }
      } else if (!strcmp(func, "vnetDeleteChain") || !strcmp(func, "vnetCreateChain")) { 
        vnetConfig *a = va_arg(al, vnetConfig *);
        char *b = va_arg(al, char *);
        char *c = va_arg(al, char *);
        if (!a || !b || !c) {
          fail=1;
        }
      } else if (!strcmp(func, "vnetTableRule")) {
        vnetConfig *a = va_arg(al, vnetConfig *);
        char *b = va_arg(al, char *);
        char *c = va_arg(al, char *);
        char *d = va_arg(al, char *);
        char *e = va_arg(al, char *);
        char *f = va_arg(al, char *);
        char *g = va_arg(al, char *);
        if (!a || !b || !c || !d || (!e && !f && !g)) {
          fail=1;
        }
      } else if (!strcmp(func, "vnetSetVlan")) {
        vnetConfig *a = va_arg(al, vnetConfig *);
        int b = va_arg(al, int);
        char *c = va_arg(al, char *);
        char *d = va_arg(al, char *);
        if (!a || b < 0 || b >= NUMBER_OF_VLANS || !c || !d) {
          fail=1;
        }
      } else if (!strcmp(func, "vnetDelVlan")) {
        vnetConfig *a = va_arg(al, vnetConfig *);
        int b = va_arg(al, int);
        if (!a || b < 0 || b >= NUMBER_OF_VLANS) {
          fail=1;
        }
      } else if (!strcmp(func, "vnetInit")) {
        vnetConfig *a = va_arg(al, vnetConfig *);
        char *b = va_arg(al, char *);
        char *c = va_arg(al, char *);
        char *d = va_arg(al, char *);
        int e = va_arg(al, int);
        if (!a || !b || !c || d<0) {
          fail=1;
        }
      }
    
      va_end(al);
    
      if (fail) {
        logprintfl (EUCAERROR, "INTERNAL ERROR: incorrect input parameters to function %s\n", func);
        return(1);
      }
      return(0);
    }

    raorn, 21 Мая 2010

    Комментарии (85)